import { EventTarget as ot, Node as Ut, Link as Ke, Rectangle as $e, EventBase as De, setProto as J, RegSystem as z, AENode as Jt, Animation as N, Shape as tn, AnchorUsageType as en, ImageNode as nn } from "@jtopo/core";
function Qt() {
  const n = ["uiContainer", "forEach", "width", "classList", "offsetWidth", "6OFnJYd", "3123432HruQEP", "display", "hide", "remove", "3294670risFCR", "841372lRjfHC", "add", "domElement", "setHtml", "240338NWbGKc", "top", "1608129SqNAXx", "defaultPrevented", "jtopo_popoupmenu", "style", "7853223BIkiGy", "initEvent", "56EajLgl", "5493762QcbwcA", "left"];
  return (Qt = function() {
    return n;
  })();
}
const et = nt;
function nt(n, t) {
  const e = Qt();
  return (nt = function(i, s) {
    return e[i -= 109];
  })(n, t);
}
(function() {
  const n = nt, t = Qt();
  for (; ; )
    try {
      if (parseInt(n(125)) / 1 + -parseInt(n(129)) / 2 * (parseInt(n(119)) / 3) + parseInt(n(120)) / 4 + parseInt(n(124)) / 5 + parseInt(n(112)) / 6 + -parseInt(n(109)) / 7 + -parseInt(n(111)) / 8 * (parseInt(n(131)) / 9) === 583797)
        break;
      t.push(t.shift());
    } catch {
      t.push(t.shift());
    }
})();
class Pn extends ot {
  constructor(t, e) {
    const i = nt;
    super(), this.stage = t, this[i(127)] = this[i(128)](e);
  }
  [et(123)]() {
    this.domElement != null && this.domElement.remove();
  }
  setHtml(t) {
    const e = et;
    this.html = t, this.remove();
    let i = document.createElement("div");
    return i[e(117)][e(126)](e(133)), this.stage[e(114)].appendChild(i), i.innerHTML = t, this.initEvent(i), this.domElement = i, this[e(122)](), i;
  }
  [et(110)](t) {
    const e = et;
    let i = this;
    t.querySelectorAll("a")[e(115)](function(s) {
      s.addEventListener("click", function(r) {
        const a = nt;
        let o = new Event("select", { cancelable: !0 });
        o.item = this.innerHTML, i.dispatchEvent(o), o[a(132)] || i[a(122)]();
      });
    });
  }
  showAt(t, e) {
    const i = et;
    let s = this.domElement, r = this.stage;
    s[i(134)][i(121)] = "block", e + s.offsetHeight >= r.height && e > r.height / 2 && (e -= s.offsetHeight), t + s.offsetWidth >= r[i(116)] && t > r.width / 2 && (t -= s[i(118)]), s[i(134)][i(113)] = t + "px", s.style[i(130)] = e + "px";
  }
  hide() {
    this.domElement.style.display = "none";
  }
}
function j(n, t) {
  const e = Yt();
  return (j = function(i, s) {
    return e[i -= 292];
  })(n, t);
}
(function() {
  const n = j, t = Yt();
  for (; ; )
    try {
      if (-parseInt(n(312)) / 1 * (parseInt(n(308)) / 2) + -parseInt(n(303)) / 3 + parseInt(n(307)) / 4 + parseInt(n(295)) / 5 * (-parseInt(n(314)) / 6) + parseInt(n(311)) / 7 + -parseInt(n(297)) / 8 * (parseInt(n(302)) / 9) + -parseInt(n(300)) / 10 * (-parseInt(n(299)) / 11) === 672363)
        break;
      t.push(t.shift());
    } catch {
      t.push(t.shift());
    }
})();
class _n extends ot {
  constructor(t) {
    const e = j;
    super(), this.stage = t, this.domElement = document.createElement("div"), this.domElement.classList[e(301)](e(315)), this.domElement.style.transition = "opacity 1s ease-in-out", this.stage.uiContainer[e(298)](this[e(306)]), this[e(294)](), this.fadeOut();
  }
  disable() {
    const t = j;
    this[t(306)] && this.domElement[t(305)]();
  }
  enabled() {
    const t = j;
    this[t(306)] && this.domElement.parentNode == null && this.stage[t(296)][t(298)](this.domElement);
  }
  setHtml(t) {
    const e = j;
    return this.domElement[e(313)] = t, this.domElement;
  }
  initEvent() {
    const t = j, e = this, i = this[t(304)].inputSystem;
    i.addEventListener("pointerdown", function() {
      e.fadeOut();
    }), i[t(292)]("pointerup", function() {
      e.fadeOut();
    }), i.addEventListener("pointermove", function() {
      i[t(309)] == null && e.fadeOut();
    });
  }
  showAt(t, e) {
    const i = j;
    this.domElement.style.display = "block", this[i(306)][i(293)].left = t + "px", this[i(306)].style.top = e + "px", requestAnimationFrame(() => {
      const s = i;
      this.domElement[s(293)].opacity = "1";
    });
  }
  fadeOut() {
    this.domElement.style.opacity = "0", setTimeout(() => {
      const t = j;
      this[t(306)][t(293)][t(310)] === "0" && (this[t(306)].style.display = "none");
    }, 100);
  }
}
function Yt() {
  const n = ["4721766AbnMHd", "7151TLXXdd", "innerHTML", "28398ThMKNC", "jtopo_tooltip", "addEventListener", "style", "initEvent", "535AvHhzl", "uiContainer", "2528544RuEfpI", "appendChild", "253AQaBrB", "449530urqLIJ", "add", "27oxjfig", "1551417vfzFXa", "stage", "remove", "domElement", "5344544kTqcnQ", "112ocVBAY", "mouseoverTarget", "opacity"];
  return (Yt = function() {
    return n;
  })();
}
const He = Gt;
function Gt(n, t) {
  const e = Xt();
  return (Gt = function(i, s) {
    return e[i -= 169];
  })(n, t);
}
function Xt() {
  const n = ["3080pQhApI", "createElement", "10467Ysuywl", "18KIQoib", "809976PpaAIw", "3216664bTFGdj", "10784994xUyaEO", `
<svg viewBox="0 0 24 24" id="zoom-in">
<path d="M4,20 L9.58788778,14.4121122"/>
<path d="M14,16 C10.6862915,16 8,13.3137085 8,10 C8,6.6862915 10.6862915,4 14,4 C17.3137085,4 20,6.6862915 20,10 C20,13.3137085 17.3137085,16 14,16 Z"/>
<path d="M16.6666667 10L11.3333333 10M14 7.33333333L14 12.6666667"/>
</svg>
<svg viewBox="0 0 24 24" id="zoom-out">
<path d="M14,16 C10.6862915,16 8,13.3137085 8,10 C8,6.6862915 10.6862915,4 14,4 C17.3137085,4 20,6.6862915 20,10 C20,13.3137085 17.3137085,16 14,16 Z"/>
<path d="M16.6666667 10L11.3333333 10M4 20L9.58788778 14.4121122"/>
</svg>
<svg viewBox="0 0 24 24" id="back-left">
<path d="M5,17 L5,15 C5,10.0294373 8.80557963,6 13.5,6 C18.1944204,6 22,10.0294373 22,15"/>
<polyline points="8 15 5 18 2 15"/>
</svg>
<svg viewBox="0 0 24 24" id="align-center">
<path d="M8 10L16 10M6 6L18 6M6 14L18 14M8 18L16 18"/>
</svg>
<svg viewBox="0 0 24 24" id="edit">
<path d="M18.4142136 4.41421356L19.5857864 5.58578644C20.366835 6.36683502 20.366835 7.63316498 19.5857864 8.41421356L8 20 4 20 4 16 15.5857864 4.41421356C16.366835 3.63316498 17.633165 3.63316498 18.4142136 4.41421356zM14 6L18 10"/>
</svg>
<svg viewBox="0 0 24 24" id="lock-alt">
<rect width="14" height="10" x="5" y="11"/>
<path d="M12,3 L12,3 C14.7614237,3 17,5.23857625 17,8 L17,11 L7,11 L7,8 C7,5.23857625 9.23857625,3 12,3 Z"/>
<circle cx="12" cy="16" r="1"/>
</svg>
<svg viewBox="0 0 24 24" id="lock-open">
<path d="M7,7.625 L7,7 C7,4.23857625 9.23857625,2 12,2 L12,2 C14.7614237,2 17,4.23857625 17,7 L17,11"/>
<rect width="14" height="10" x="5" y="11"/>
</svg>
<svg viewBox="0 0 24 24" id="pan">
<path d="M20,14 L20,17 C20,19.209139 18.209139,21 16,21 L10.0216594,21 C8.75045497,21 7.55493392,20.3957659 6.80103128,19.3722467 L3.34541668,14.6808081 C2.81508416,13.9608139 2.94777982,12.950548 3.64605479,12.391928 C4.35756041,11.8227235 5.38335813,11.8798792 6.02722571,12.5246028 L8,14.5 L8,13 L8.00393081,13 L8,11 L8.0174523,6.5 C8.0174523,5.67157288 8.68902517,5 9.5174523,5 C10.3458794,5 11.0174523,5.67157288 11.0174523,6.5 L11.0174523,11 L11.0174523,4.5 C11.0174523,3.67157288 11.6890252,3 12.5174523,3 C13.3458794,3 14.0174523,3.67157288 14.0174523,4.5 L14.0174523,11 L14.0174523,5.5 C14.0174523,4.67157288 14.6890252,4 15.5174523,4 C16.3458794,4 17.0174523,4.67157288 17.0174523,5.5 L17.0174523,11 L17.0174523,7.5 C17.0174523,6.67157288 17.6890252,6 18.5174523,6 C19.3458794,6 20.0174523,6.67157288 20.0174523,7.5 L20.0058962,14 L20,14 Z"/>
</svg>
<svg viewBox="0 0 24 24" id="apps-alt">
<rect x="5" y="5" width="2" height="2"/>
<rect x="11" y="5" width="2" height="2"/>
<rect x="17" y="5" width="2" height="2"/>
<rect x="5" y="11" width="2" height="2"/>
<rect x="11" y="11" width="2" height="2"/>
<rect x="17" y="11" width="2" height="2"/>
<rect x="5" y="17" width="2" height="2"/>
<rect x="11" y="17" width="2" height="2"/>
<rect x="17" y="17" width="2" height="2"/>
</svg>
<svg viewBox="0 0 24 24" id="maximise">
<polyline points="21 16 21 21 16 21"/>
<polyline points="8 21 3 21 3 16"/>
<polyline points="16 3 21 3 21 8"/>
<polyline points="3 8 3 3 8 3"/>
</svg>
<svg viewBox="0 0 24 24" id="minimise">
<polyline points="8 3 8 8 3 8"/>
<polyline points="21 8 16 8 16 3"/>
<polyline points="3 16 8 16 8 21"/>
<polyline points="16 21 16 16 21 16"/>
</svg>
<svg viewBox="0 0 24 24" id="download">
<path d="M12,3 L12,16"/>
<polyline points="7 12 12 17 17 12"/>
<path d="M20,21 L4,21"/>
</svg>
<svg viewBox="0 0 24 24" id="rectangle">
<rect width="18" height="18" x="3" y="3"/>
</svg>
<svg viewBox="0 0 24 24" id="cursor">
<polygon points="7 20 7 4 19 16 12 16 7 21"/>
</svg>
<svg viewBox="0 0 24 24" id="search">
<path d="M14.4121122,14.4121122 L20,20"/>
<circle cx="10" cy="10" r="6"/>
</svg>
<svg viewBox="0 0 24 24" id="eye">
<path d="M22 12C22 12 19 18 12 18C5 18 2 12 2 12C2 12 5 6 12 6C19 6 22 12 22 12Z"/>
<circle cx="12" cy="12" r="3"/>
</svg>
<svg viewBox="0 0 24 24" id="save">
<path d="M17.2928932,3.29289322 L21,7 L21,20 C21,20.5522847 20.5522847,21 20,21 L4,21 C3.44771525,21 3,20.5522847 3,20 L3,4 C3,3.44771525 3.44771525,3 4,3 L16.5857864,3 C16.8510029,3 17.1053568,3.10535684 17.2928932,3.29289322 Z"/>
<rect width="10" height="8" x="7" y="13"/>
<rect width="8" height="5" x="8" y="3"/>
</svg>
<svg viewBox="0 0 24 24" id="image">
<rect width="18" height="18" x="3" y="3"/>
<path stroke-linecap="round" d="M3 14l4-4 11 11"/>
<circle cx="13.5" cy="7.5" r="2.5"/>
<path stroke-linecap="round" d="M13.5 16.5L21 9"/>
</svg>
<svg viewBox="0 0 24 24" id="upload">
<path d="M12,4 L12,17"/>
<polyline points="7 8 12 3 17 8"/>
<path d="M20,21 L4,21"/>
</svg>
`, "2pPwsGg", "12wIYvOe", "3339385PoHAqd", "420007AoOeTj", "6lpHAsg", "58615CqrCvO"];
  return (Xt = function() {
    return n;
  })();
}
(function() {
  const n = Gt, t = Xt();
  for (; ; )
    try {
      if (parseInt(n(175)) / 1 * (parseInt(n(172)) / 2) + -parseInt(n(176)) / 3 * (-parseInt(n(182)) / 4) + -parseInt(n(177)) / 5 * (-parseInt(n(181)) / 6) + parseInt(n(174)) / 7 + -parseInt(n(169)) / 8 + -parseInt(n(180)) / 9 * (-parseInt(n(178)) / 10) + -parseInt(n(170)) / 11 * (parseInt(n(173)) / 12) === 312886)
        break;
      t.push(t.shift());
    } catch {
      t.push(t.shift());
    }
})();
let sn = He(171), Be = document[He(179)]("div");
Be.innerHTML = sn;
let Re = { get: function(n) {
  return Be.querySelector("#" + n);
} };
const b = at;
function at(n, t) {
  const e = Vt();
  return (at = function(i, s) {
    return e[i -= 154];
  })(n, t);
}
function I(n) {
  const t = at;
  return Re.get(n)[t(175)];
}
(function() {
  const n = at, t = Vt();
  for (; ; )
    try {
      if (-parseInt(n(196)) / 1 + parseInt(n(169)) / 2 + -parseInt(n(176)) / 3 * (-parseInt(n(183)) / 4) + -parseInt(n(174)) / 5 * (-parseInt(n(159)) / 6) + parseInt(n(203)) / 7 * (-parseInt(n(161)) / 8) + -parseInt(n(158)) / 9 * (-parseInt(n(167)) / 10) + parseInt(n(207)) / 11 === 380559)
        break;
      t.push(t.shift());
    } catch {
      t.push(t.shift());
    }
})();
let rn = `
<div class="group">
<button title="默认" class="item active" group='mode' iconId='cursor'>` + I("cursor") + `</button>
<button title="编辑模式" edit="true" class="item" group='mode' iconId='edit' style="display:none">` + I("edit") + `</button>
<button title="框选模式" class="item" group='mode' iconId='rectangle'>` + I("rectangle") + `</button>
<button title="拖拽模式"  class="item" group='mode' iconId='pan'>` + I("pan") + b(171) + I("lock-alt") + `</button>
</div>
<div class="group">
<button title="放大"  class="item" iconId='zoom-in'>` + I("zoom-in") + `</button>
<button title="缩小"  class="item" iconId='zoom-out'>` + I(b(195)) + `</button>
<button title="居中" class="item" iconId='align-center'>` + I("align-center") + `</button>
<button title="缩放至画布" class="item" iconId='minimise'>` + I(b(165)) + `</button>
<button title="取消缩放" class="item" iconId='back-left'>` + I("back-left") + `</button>
</div>
<div class="group">
<button title="缩略图" class="item" iconId='eye'>` + I(b(182)) + b(190) + I("maximise") + `</button>
<input title="查找" type="text" placeholder="查找" value=""></input>
<button class="item" iconId='search'>` + Re.get("search").outerHTML + `</button>
</div>
<div class="group">
<button title="导出PNG" class="item" iconId='image'>` + I("image") + b(204) + I("upload") + `</button>
<button title="保存到本地" class="item" iconId='save'>` + I(b(197)) + `</button>
<div style="display:none;"><input type="file"/></div>
</div>
`;
function Vt() {
  const n = ['input[type="text"]', "button", "4048088huufxE", "showOverview", ".json", "Enter", "querySelector", "domElement", "lookAtObject", "43389LoShdi", "1608ztJNry", "style", "37296IzCVQN", "activeButton", "domObj", "text", "minimise", "getAttribute", "410fOELxE", 'button[title="', "475828cbgRJb", "group", `</button>
<button title="锁定模式" class="item" group='mode' iconId='lock-alt'>`, "camera", "zoomIn", "1415kxLLgP", "outerHTML", "1570719QcRnya", "zoom", "hideOverview", "onload", "prepend", "initActiveStatus", "eye", "4ymtpEy", "showButton", "select", "getCurrentLayer", "toJSONWithBase64", "onkeydown", "none", `</button>
<button title="浏览器全屏" class="item" iconId='maximise'>`, "target", "iconId", "edit", "display", "zoom-out", "453677UipsPU", "save", "overview", "files", "imageToBase64", "stringify", "length", "854ljuvUh", `</button>
<button title="打开本地文件" class="item" iconId='upload'>`];
  return (Vt = function() {
    return n;
  })();
}
class Nn {
  constructor(t) {
    const e = b;
    this[e(200)] = !0, this.stage = t, this.initToolbar(t, rn), t[e(156)][e(180)](this.getDom());
    let i = this;
    setTimeout(function() {
      i[e(181)]();
    }, 200);
  }
  [b(184)](t) {
    const e = b;
    let i = this[e(163)].querySelector(e(168) + t + '"]');
    i != null && (i.style.display = "block");
  }
  hideButton(t) {
    const e = b;
    let i = this[e(163)].querySelector('button[title="' + t + '"]');
    i != null && (i[e(160)].display = e(189));
  }
  getDom() {
    return this.domObj;
  }
  show() {
    const t = b;
    this.domObj.style[t(194)] = "block";
  }
  hide() {
    this.domObj.style.display = "none";
  }
  remove() {
    this[b(163)].remove();
  }
  [b(181)]() {
    const t = b;
    if (this.stage.mode == t(193)) {
      let e = document.querySelector("button[iconid='edit']");
      this[t(162)](e);
    }
  }
  initToolbar(t, e) {
    const i = b;
    let s = this, r = document.createElement("div");
    this.domObj = r, r.classList.add("jtopo_toolbar"), r.innerHTML = e;
    let a = r.querySelectorAll(i(206));
    this.buttons = a;
    let o = r[i(155)]('input[type="file"]'), l = o.parentNode;
    function h(d) {
      const g = i;
      l.innerHTML = '<input type="file"/>', c();
      let m = d[g(191)][g(199)][0];
      const v = new FileReader();
      v.readAsText(m), v[g(179)] = function() {
        try {
          const E = JSON.parse(this.result);
          s.stage.fromJSON(E).then(() => {
            document.title = m.name;
          });
        } catch (E) {
          console.log(E), alert("加载出现错误");
        }
      };
    }
    function c() {
      o = r[i(155)]('input[type="file"]'), o.addEventListener("change", h);
    }
    function p() {
      const d = i;
      let g = t[d(186)](), m = r.querySelector(d(205)).value;
      if (m.length > 0) {
        let v = g[d(155)](function(E) {
          return E[d(164)] != null && E.text.indexOf(m) != -1;
        });
        v && (t[d(172)][d(157)](v), t.effectSystem.flash(v).play());
      }
    }
    c(), this.fileInput = o;
    let u = { cursor: function() {
      t.setMode("normal");
    }, rectangle: function() {
      const d = i;
      t.setMode(d(185));
    }, pan: function() {
      t.setMode("drag");
    }, edit: function() {
      const d = i;
      t.setMode(d(193));
    }, "lock-alt": function() {
      t.setMode("view");
    }, eye: function() {
      const d = i;
      t[d(198)] == null || t.overview.visible == 0 ? t[d(208)]() : t[d(178)]();
    }, "zoom-in": function() {
      const d = i;
      t.camera[d(173)]();
    }, "zoom-out": function() {
      t.camera.zoomOut();
    }, "back-left": function() {
      const d = i;
      t.camera.lookAt(0, 0), t.camera[d(177)](1);
    }, minimise: function() {
      t.camera.zoomToFit();
    }, "align-center": function() {
      t.camera.lookAtContentCenter();
    }, maximise: function() {
      t.fullWindow();
    }, image: function() {
      t.saveImageInfo();
    }, save: async function() {
      const d = i;
      let g = prompt("要保存的文件名："), m = s.imageToBase64;
      if (g != null)
        if (m)
          t[d(187)]().then((v) => {
            const E = d;
            let G = JSON[E(201)](v);
            t.download(g + E(209), G);
          });
        else {
          let v = t.toJSON(), E = JSON.stringify(v);
          t.download(g + ".json", E);
        }
    }, upload: function() {
      o.click();
    }, search: p };
    function f(d) {
      d.onclick = function() {
        const g = at;
        let m = d[g(166)](g(192));
        u[m](), s[g(162)](d);
      };
    }
    r[i(155)]("input")[i(188)] = function(d) {
      const g = i;
      d.key == g(154) && p();
    };
    for (let d = 0; d < a.length; d++)
      f(a[d]);
  }
  activeButton(t) {
    const e = b;
    let i = t;
    typeof t == "string" && (i = this.domObj.querySelector('button[title="' + t + '"]'));
    let s = i[e(166)]("group");
    s != null && (this.removeAllActive(s), i.classList.add("active"));
  }
  removeAllActive(t) {
    const e = b;
    let i = this.buttons;
    for (let s = 0; s < i[e(202)]; s++) {
      let r = i[s];
      t == r.getAttribute(e(170)) && r.classList.remove("active");
    }
  }
}
const x = it;
function it(n, t) {
  const e = Zt();
  return (it = function(i, s) {
    return e[i -= 320];
  })(n, t);
}
function Zt() {
  const n = ["style", "fontWeight", "height", "pointerdown", "4gPshvL", "removeEventListener", "412WDmWMG", "none", "key", "dblclickHandler", "hide", "createMeasurementSpan", "stage", "Enter", "233163mPvdqt", "pointerHandler", "disabled", "span", "852RgYWan", "setValue", "substring", "auto", "textY", "inputSystem", "left", "classList", "camera", "onkeydown", "bind", "cancel", "ctrlKey", "toScreenXY", "pointermove", "36wQDrBg", "selectionEnd", "pointerdownHandler", "139130TLEmHA", "fontSize", "textAlign", "destroy", "26610qbUMna", "visibility", "pointerupHandler", "display", "defaultPrevented", "wordWrap", "oninput", "3324osIlbQ", "textarea", "dblclick", "_textPosition", "addEventListener", "187LauPER", "bottom", "max", "inputHandler", "adjustTextareaWidth", "6176800LUNomg", "78299anEFAP", "text", "show", "createElement", "textX", "position", "191OVDUxQ", "target", "value", "docPointdownHandler", "395344jtJJRd"];
  return (Zt = function() {
    return n;
  })();
}
(function() {
  const n = it, t = Zt();
  for (; ; )
    try {
      if (parseInt(n(384)) / 1 * (-parseInt(n(326)) / 2) + -parseInt(n(334)) / 3 * (-parseInt(n(324)) / 4) + parseInt(n(360)) / 5 * (parseInt(n(338)) / 6) + parseInt(n(377)) / 7 + parseInt(n(388)) / 8 * (parseInt(n(353)) / 9) + -parseInt(n(356)) / 10 * (-parseInt(n(372)) / 11) + parseInt(n(367)) / 12 * (-parseInt(n(378)) / 13) === 442321)
        break;
      t.push(t.shift());
    } catch {
      t.push(t.shift());
    }
})();
class Oe extends De {
  constructor(t, e) {
    super(t, e);
  }
}
class Wn extends ot {
  constructor(t) {
    const e = it;
    super(), this[e(336)] = !1, this.enabledModes = ["edit"], this.stage = t;
    let i = document[e(381)](e(368));
    i[e(345)].add("jtopo_input_textfield"), this.stage.uiContainer.appendChild(i), this.measurementSpan = this.createMeasurementSpan();
    let s = this;
    i[e(347)] = function(r) {
      s.onkeydown(r);
    }, i.oninput = function(r) {
      s[e(375)](r);
    }, this.textarea = i, t[e(343)].addEventListener(e(369), this[e(329)].bind(this)), t.inputSystem.addEventListener("pointerdown", this[e(355)].bind(this)), t.inputSystem.addEventListener("pointerup", this.pointerupHandler.bind(this)), t[e(343)].addEventListener(e(352), this.pointerHandler.bind(this)), document.addEventListener(e(323), this[e(387)][e(348)](this)), t.camera[e(371)]("zoom", this.zoomHandler.bind(this));
  }
  zoomHandler(t) {
    this[it(330)]();
  }
  [x(387)](t) {
    let e = t.target;
    e != null ? e !== this.textarea && this.hide() : this.hide();
  }
  inputHandler(t) {
    this.target != null && this.adjustTextareaWidth();
  }
  [x(331)]() {
    const t = x;
    let e = document.createElement(t(337));
    return e[t(345)].add("jtopo_measurement_span"), e.style[t(361)] = "hidden", e[t(320)][t(383)] = "absolute", e.style.whiteSpace = "pre-wrap", e[t(320)][t(365)] = t(327), e.style[t(363)] = "inline-block", e[t(320)].minWidth = "10px", this.stage.uiContainer.appendChild(e), e;
  }
  dblclickHandler(t) {
    const e = x;
    if (this.disabled || this.enabledModes.indexOf(this.stage.mode) == -1)
      return;
    let i = this.stage.inputSystem.target;
    i != null ? this.attachTo(i) : this[e(349)]();
  }
  [x(335)](t) {
    const e = x;
    this[e(332)][e(343)].isPointerDown && this[e(349)]();
  }
  pointerdownHandler(t) {
    const e = x;
    this[e(332)][e(343)][e(385)] == null && this.cancel();
  }
  pointerupHandler(t) {
    this[x(332)].inputSystem.target == null && this.cancel();
  }
  attachTo(t) {
    const e = x;
    let i;
    if (this[e(330)](), this.target = t, t instanceof Ut ? i = t : t instanceof Ke && (i = t.getLabel()), i == null)
      return;
    let s = new $e(0, 0, i._textWidth, i._textHeight), r = this.stage[e(346)].toScreenRect(s), a = i.getComputedStyle(), o = parseInt(a.fontSize) * this[e(332)][e(346)].scale;
    this.textarea[e(320)].fontFamily = a.fontFamily, this.textarea[e(320)][e(321)] = a.fontWeight, this.textarea.style.fontSize = o + "px", this.measurementSpan.style.fontFamily = a.fontFamily, this.measurementSpan.style.fontWeight = a.fontWeight, this.measurementSpan.style[e(357)] = o + "px";
    let l = a[e(358)], h = a.textBaseline, c = i[e(370)], p = i.localToWorldXY(c.x, c.y), u = this[e(332)].camera[e(351)](p.x, p.y), f = Math[e(374)](r.width, 30), d = Math.max(r.height, 20), g = u.x - f / 2, m = u.y - d / 2;
    l == e(344) ? g = u.x - f / 2 : l == "right" && (g = u.x + f / 2), h == "top" ? m = u.y - d / 2 : h == e(373) && (m = u.y + d / 2), this[e(382)] = g, this.textY = m, this.setValue(i[e(379)]), this.show();
  }
  [x(339)](t) {
    this.textarea.value = t, this.adjustTextareaWidth();
  }
  [x(380)]() {
    const t = x;
    this.textarea.style[t(363)] = "block", this[t(368)].focus(), this.textarea.select(), this[t(368)].style[t(344)] = this.textX + "px", this.textarea.style.top = this[t(342)] + "px", this[t(376)]();
  }
  hide() {
    const t = x;
    this[t(368)].style.display = t(327);
  }
  [x(347)](t) {
    const e = x;
    if (t[e(328)] != "Escape") {
      if (t.key == e(333)) {
        if (t[e(350)]) {
          const i = this.textarea, s = i.selectionStart, r = i[e(354)];
          i.value = i.value[e(340)](0, s) + `
` + i[e(386)].substring(r), i.selectionStart = i[e(354)] = s + 1, this.adjustTextareaWidth();
        } else {
          if (this[e(385)] == null)
            return;
          this.applyInput();
        }
        t.preventDefault();
      }
    } else
      this.cancel();
  }
  applyInput() {
    const t = x;
    let e = this.target;
    if (e == null)
      return;
    const i = this.textarea;
    let s = new Oe("confirm", { target: e, text: i[t(386)] });
    this.dispatchEvent(s), this[t(330)](), s[t(364)] || (e.text = i.value);
  }
  [x(349)]() {
    const t = x;
    let e = this.target;
    e != null && (this[t(330)](), this.dispatchEvent(new Oe(t(349), { target: e })));
  }
  adjustTextareaWidth() {
    const t = x;
    let e = this.measurementSpan;
    e.textContent = this[t(368)].value;
    const i = e.offsetWidth + 10;
    this.textarea.style.width = i + "px", this.textarea[t(320)].height = t(341), this.textarea.style[t(322)] = this[t(368)].scrollHeight + "px";
  }
  [x(359)]() {
    const t = x;
    this.textarea.onkeydown = null, this[t(368)][t(366)] = null, document[t(325)]("pointerdown", this[t(387)]), this.removeEventListener("dblclick", this[t(329)]), this[t(325)]("pointerdown", this.pointerdownHandler), this[t(325)]("pointerup", this[t(362)]), this.removeEventListener("pointermove", this.pointerHandler), this.textarea.remove();
  }
}
const F = It;
function Kt() {
  const n = ["2987424iofAJn", "_beforDraw", "com.jtopo.extensions", "draw", "regClass", "inLinks", "1204UJkpXH", "height", "6972136IWPaOc", "_drawData", "getBeginPoint", "38785aCcitt", "outLinks", "width", "blue", "32857rYXDOQ", "2748xUZFKB", "796PSrhxs", "length", "cos", "2024250TTngzV", "1351125isDgqF", "JointLNode", "moveTo", "7oNWCLk", "3250ijlwqb"];
  return (Kt = function() {
    return n;
  })();
}
(function() {
  const n = It, t = Kt();
  for (; ; )
    try {
      if (parseInt(n(377)) / 1 + parseInt(n(362)) / 2 * (parseInt(n(372)) / 3) + -parseInt(n(373)) / 4 * (parseInt(n(367)) / 5) + parseInt(n(376)) / 6 + -parseInt(n(380)) / 7 * (-parseInt(n(364)) / 8) + parseInt(n(356)) / 9 + -parseInt(n(355)) / 10 * (parseInt(n(371)) / 11) === 928967)
        break;
      t.push(t.shift());
    } catch {
      t.push(t.shift());
    }
})();
var on = Object.defineProperty, an = Object.getOwnPropertyDescriptor;
function It(n, t) {
  const e = Kt();
  return (It = function(i, s) {
    return e[i -= 355];
  })(n, t);
}
class je extends Ut {
  constructor(t, e = 0, i = 0, s = 1, r = 1) {
    super(t, e, i, s, r), this._drawData = { a: { x: 0, y: 0 }, z: { x: 0, y: 0 } };
  }
  [F(357)]() {
    const t = F;
    let e = this[t(361)], i = this[t(368)];
    const s = this;
    let r = 0, a = 0;
    e.length > 0 && (r = Pe(s.inLinks[0][t(366)](), s)), i.length > 0 && (a = Pe(s.outLinks[0].getEndPoint(), s));
    let o = Math.min(this[t(369)] / 2, this[t(363)] / 2);
    this._drawData.a = { x: Math.cos(r) / 1.618 * o, y: Math.sin(r) / 1.618 * o }, this[t(365)].z = { x: Math[t(375)](a) / 1.618 * o, y: Math.sin(a) / 1.618 * o };
  }
  [F(359)](t) {
    const e = F;
    t.strokeStyle = e(370), t.lineCap = "square", t.lineWidth = 20, this._beforDraw();
    let i = this._drawData.a, s = this._drawData.z;
    t.beginPath(), t[e(379)](i.x, i.y), t.lineTo(i.x / 1.618, i.y / 1.618), t.quadraticCurveTo(0, 0, s.x / 1.618, s.y / 1.618), t.lineTo(s.x, s.y), t.stroke();
  }
}
function Pe(n, t) {
  let e = n.x - t.x, i = n.y - t.y;
  return Math.atan2(i, e);
}
((n, t, e, i) => {
  const s = It;
  for (var r, a = i > 1 ? void 0 : i ? an(t, e) : t, o = n[s(374)] - 1; o >= 0; o--)
    (r = n[o]) && (a = (i ? r(t, e, a) : r(a)) || a);
  i && a && on(t, e, a);
})([J(F(378))], je.prototype, "className", 2), z[F(360)](F(358), "JointLNode", je);
const Q = te;
(function() {
  const n = te, t = $t();
  for (; ; )
    try {
      if (parseInt(n(257)) / 1 + -parseInt(n(236)) / 2 * (parseInt(n(247)) / 3) + parseInt(n(253)) / 4 + parseInt(n(256)) / 5 * (parseInt(n(250)) / 6) + -parseInt(n(237)) / 7 + -parseInt(n(258)) / 8 * (parseInt(n(245)) / 9) + -parseInt(n(254)) / 10 * (-parseInt(n(255)) / 11) === 819618)
        break;
      t.push(t.shift());
    } catch {
      t.push(t.shift());
    }
})();
var ln = Object[Q(238)], hn = Object.getOwnPropertyDescriptor;
function $t() {
  const n = ["1396810QfpGkn", "2649542TQITac", "defineProperty", "restore", "shadowOffsetY", "_paintText", "arrowNumbers", "BlinkingArrowNode", "aeOptions", "2043zSMYmG", "strokeStyle", "3UAxdsb", "padding", "applyTo", "987522SYkkLC", "stroke", "lineWidth", "1117400tHzbYA", "70FrWQUP", "1162117UXuWqD", "5HIUIUj", "839502iWfsMt", "4456qvxdHx", "height", "push", "setAttributes"];
  return ($t = function() {
    return n;
  })();
}
function te(n, t) {
  const e = $t();
  return (te = function(i, s) {
    return e[i -= 236];
  })(n, t);
}
class _e extends Jt {
  constructor(t, e = 0, i = 0, s = 1, r = 1) {
    const a = Q;
    super(t, e, i, s, r), this[a(244)] = { arrowNumbers: 5, blinkFrequency: 1e3 }, this.aeStatus = {};
  }
  ae(t) {
    Object.assign(this.aeOptions, t);
  }
  setupAE() {
    const t = Q;
    let e = [];
    this.aeStatus.alphas = e;
    let i = this.aeOptions.arrowNumbers;
    for (let a = 0; a < i; a++)
      e.push(0.5);
    let s = this, r = new N();
    r.name = "BlinkingArrow", r[t(261)]({ from: 0, to: i, duration: s.aeOptions.blinkFrequency, times: 1 / 0, update: (a) => {
      let o = Math.round(a);
      o > i || (o > 0 && (e[o - 1] = 0.5), o == 0 && (e[e.length - 1] = 0.5), e[o] = 1, s.update());
    } }), this.animations[t(260)](r);
  }
  draw(t) {
    const e = Q;
    let i = this.width, s = this[e(259)], r = this.getComputedStyle();
    r[e(249)](t);
    let a = r.borderWidth || 0, o = r[e(248)] || 0, l = 0.5 * -i + a + o, h = (i - (2 * o + 2 * a)) / this.aeOptions.arrowNumbers, c = this.aeStatus.alphas;
    for (let p = 0; p < this[e(244)][e(242)]; p++)
      t.save(), t.beginPath(), c[p] == 1 && (t[e(240)] = 2, t.shadowOffsetX = 2, t.shadowColor = r[e(246)] || "gray", t.lineWidth = 0.5 * r.lineWidth + 0.5 * c[p] * r[e(252)], t.shadowBlur = 13 * c[p]), t.globalAlpha = c[p], t.moveTo(l + h * p, 0.5 * -s), t.lineTo(l + h * p + 0.5 * h, 0), t.lineTo(l + h * p, 0.5 * s), t[e(251)](), t[e(239)]();
    this[e(241)](t);
  }
  destroy() {
    super.destroy(), this.aeStatus = null;
  }
}
((n, t, e, i) => {
  for (var s, r = i > 1 ? void 0 : i ? hn(t, e) : t, a = n.length - 1; a >= 0; a--)
    (s = n[a]) && (r = (i ? s(t, e, r) : s(r)) || r);
  i && r && ln(t, e, r);
})([J(Q(243))], _e.prototype, "className", 2), z.regClass("com.jtopo.extensions", Q(243), _e);
const C = st;
function ee() {
  const n = ["draw", "_onAEChanged", "28jnfjKZ", "760546LLFmHs", "animations", "strokeStyle", "aeOptions", "1817180nfmpZo", "ellipse", "4RMUEtB", "_width", "circleNumber", "getComputedStyle", "height", "354287sIvbyj", "radius", "2437818vqinfq", "globalAlpha", "536552kekppU", "lineWidth", "prototype", "radiusMax", "circles", "radiusDx", "aeStatus", "1649457PmhkPM", "364929yCNTQc", "RipplingNode", "forEach"];
  return (ee = function() {
    return n;
  })();
}
(function() {
  const n = st, t = ee();
  for (; ; )
    try {
      if (-parseInt(n(254)) / 1 + parseInt(n(243)) / 2 + -parseInt(n(237)) / 3 + parseInt(n(249)) / 4 * (parseInt(n(247)) / 5) + -parseInt(n(256)) / 6 + parseInt(n(242)) / 7 * (parseInt(n(258)) / 8) + parseInt(n(236)) / 9 === 313025)
        break;
      t.push(t.shift());
    } catch {
      t.push(t.shift());
    }
})();
var cn = Object.defineProperty, un = Object.getOwnPropertyDescriptor;
class Ne extends Jt {
  constructor(t, e = 0, i = 0, s = 50, r = 50) {
    const a = st;
    super(t, e, i, s, r), this[a(246)] = { circleNumber: 2 }, this[a(235)] = { circles: [], radiusMax: 1, radiusDx: 0, circleNumber: 0, lineWidthMax: 6 };
  }
  ae(t) {
    Object.assign(this.aeOptions, t), this._onAEChanged();
  }
  [C(241)]() {
    const t = C;
    let e = this.aeStatus, i = this.aeOptions, s = 0.5 * Math.min(this.width, this.height), r = i[t(251)] || 5;
    if (e.circleNumber !== r) {
      e.circleNumber = r;
      const a = [];
      for (let o = 0; o < e[t(251)]; o++)
        a.push({ radius: 0, lineWidth: 0, globalAlpha: 0 });
      e.circles = a;
    }
    e.radiusMax !== s && this[t(244)] && this.animations[t(239)]((a) => {
      a.to = [e.radiusMax];
    }), e.radiusMax = s, e.radiusDx = e[t(232)] / r;
  }
  _afterStyleComputed() {
    const t = C;
    super._afterStyleComputed(), this[t(235)].lineWidthMax = this[t(252)]()[t(259)] || 6;
  }
  setupAE() {
    let t = this.aeStatus;
    this._onAEChanged();
    let e = new N({ object: this, name: "Rippling", from: [1], to: [t.radiusMax], update: (i) => {
      const s = st;
      let r = t.circles, a = Math.max(i[0], 0);
      for (let o = 0; o < r.length; o++) {
        let l = r[o], h = a + o * t[s(234)];
        h > t.radiusMax && (h %= t.radiusMax);
        let c = h / t[s(232)];
        l.radius = h, l.lineWidth = c * t.lineWidthMax, l.globalAlpha = 1 - Math.min(1, h / t[s(232)]);
      }
    }, times: 1 / 0, duration: 2e3 });
    this.animations.push(e);
  }
  set width(t) {
    const e = C;
    super.width = t, this[e(241)]();
  }
  get width() {
    return this[C(250)];
  }
  set [C(253)](t) {
    super.height = t, this._onAEChanged();
  }
  get height() {
    return this._height;
  }
  [C(240)](t) {
    const e = C;
    let i = this.aeStatus[e(233)], s = this.getComputedStyle();
    t.strokeStyle = s[e(245)];
    for (let r = 0; r < i.length; r++) {
      let a = i[r];
      t.beginPath(), t.lineWidth = a[e(259)], t[e(257)] = a.globalAlpha, t[e(248)](0, 0, a.radius, a[e(255)], 0, 0, 2 * Math.PI), t.stroke();
    }
  }
}
function st(n, t) {
  const e = ee();
  return (st = function(i, s) {
    return e[i -= 231];
  })(n, t);
}
((n, t, e, i) => {
  for (var s, r = i > 1 ? void 0 : i ? un(t, e) : t, a = n.length - 1; a >= 0; a--)
    (s = n[a]) && (r = (i ? s(t, e, r) : s(r)) || r);
  i && r && cn(t, e, r);
})([J(C(238))], Ne[C(231)], "className", 2), z.regClass("com.jtopo.extensions", "RipplingNode", Ne);
const S = rt;
(function() {
  const n = rt, t = ne();
  for (; ; )
    try {
      if (parseInt(n(486)) / 1 * (parseInt(n(484)) / 2) + parseInt(n(485)) / 3 * (parseInt(n(483)) / 4) + -parseInt(n(466)) / 5 * (-parseInt(n(464)) / 6) + parseInt(n(473)) / 7 + parseInt(n(458)) / 8 * (-parseInt(n(474)) / 9) + -parseInt(n(489)) / 10 * (parseInt(n(487)) / 11) + parseInt(n(491)) / 12 * (-parseInt(n(471)) / 13) === 944405)
        break;
      t.push(t.shift());
    } catch {
      t.push(t.shift());
    }
})();
var pn = Object.defineProperty, dn = Object.getOwnPropertyDescriptor;
function ne() {
  const n = ["destroy", "closePath", "_onAEChanged", "472615OHfHtj", "bezierCurveTo", "11639222TrWRCZ", "153243ltdVMC", "borderRadius", "com.jtopo.extensions", "animations", "waveHeight", "width", "_height", "leftPoints", "strokeStyle", "105396efTbyn", "2975916QOLuBr", "93lxDfwK", "1HUGuww", "1199IJqaKZ", "rightPoints", "150730UZbPpP", "WaterLike", "552MWWDbt", "clip", "_getShapeSize", "roundRect", "aeStatus", "24xZJKul", "stroke", "fillStyle", "height", "color", "_updateShapeSize", "8238DNWqTf", "prototype", "1250aXYTph", "setupAE"];
  return (ne = function() {
    return n;
  })();
}
function rt(n, t) {
  const e = ne();
  return (rt = function(i, s) {
    return e[i -= 458];
  })(n, t);
}
class We extends Jt {
  constructor(t, e = 0, i = 0, s = 1, r = 1) {
    const a = rt;
    super(t, e, i, s, r), this.aeOptions = { capacity: 0.5, waveHeight: 10 }, this[a(495)] = { leftPoints: [], rightPoints: [], capacity: 0, width: -1, height: -1, waveHeight: 0 }, this.setStyle(a(460), "#43b1f5");
  }
  ae(t) {
    Object.assign(this.aeOptions, t), this._onAEChanged();
  }
  _afterStyleComputed() {
    super._afterStyleComputed(), this._onAEChanged();
  }
  _updateWaveline() {
    const t = rt, e = this.aeStatus;
    let i = e[t(481)], s = e[t(488)], r = e[t(461)] * (1 - e.capacity) - 0.5 * e[t(461)];
    i[0].y = r, i[1].y = r + e.waveHeight, i[2].y = r - e[t(478)], i[3].y = r, s[0].y = i[0].y, s[1].y = i[1].y, s[2].y = i[2].y, s[3].y = i[3].y;
  }
  [S(470)]() {
    const t = S, e = this.aeStatus, i = this._getShapeSize(), s = this.aeOptions[t(478)] == null ? 10 : this.aeOptions.waveHeight, r = this.aeOptions.capacity == null ? 0.5 : this.aeOptions.capacity;
    if (e.width !== i.width || e[t(461)] !== i.height) {
      this[t(463)]();
      let a = this._getShapeSize().width, o = -a / 2, l = [{ x: o, y: 0 }, { x: o + a / 4, y: 0 }, { x: o + a - a / 4, y: 0 }, { x: o + a, y: 0 }], h = l.map((c) => ({ x: c.x + a, y: c.y }));
      e.leftPoints = l, e.rightPoints = h;
    }
    e[t(478)] = s, e.width = i[t(479)], e[t(461)] = i.height, e.capacity = r, this._updateWaveline();
  }
  [S(467)]() {
    const t = S, e = this.aeStatus;
    let i = new N({ name: t(490), from: 0, to: 1, duration: 1500, times: 1 / 0, update: (s) => {
      const r = t;
      let a = e.width, o = 0.01 * a, l = 0.5 * a, h = e[r(481)], c = e.rightPoints;
      c[0].x >= l && (c[0].x = -l - a, c[1].x = c[0].x + a / 4, c[3].x = c[0].x + a, c[2].x = c[3].x - a / 4), h[0].x >= l && (h[0].x = -l - a, h[1].x = h[0].x + a / 4, h[3].x = h[0].x + a, h[2].x = h[3].x - a / 4), h.forEach((p, u) => {
        p.x += o;
      }), c.forEach((p, u) => {
        p.x += o;
      });
    } });
    this._onAEChanged(), this[t(477)].push(i);
  }
  draw(t) {
    const e = S;
    let i = this[e(493)](), s = i.width, r = i[e(461)], a = this.getComputedStyle();
    a.applyTo(t);
    let o = a.lineWidth, l = 0.5 * -s, h = 0.5 * -r;
    t.beginPath(), a.borderRadius != null ? t[e(494)](l, h, s, r, a[e(475)]) : t.rect(l, h, s, r), t.closePath(), o != 0 && t.stroke();
    {
      t.save();
      let c = 0.5 * o;
      t.beginPath(), a.borderRadius != null ? t.roundRect(l + c, h + c, s - o, r - o, a.borderRadius) : t.rect(l + c, h + c, s - o, r - o), t[e(469)](), o != 0 && (t.lineWidth = 2 * o, t[e(482)] = "rgba(0,0,0,0)", t[e(459)]()), t[e(492)]();
      let p = this.aeStatus.leftPoints, u = this[e(495)].rightPoints;
      if (t.beginPath(), p[0].x >= u[0].x) {
        let f = p;
        p = u, u = f;
      }
      t.moveTo(p[0].x, p[0].y), t.bezierCurveTo(p[1].x, p[1].y, p[2].x, p[2].y, p[3].x, p[3].y), t[e(472)](u[1].x, u[1].y, u[2].x, u[2].y, u[3].x, u[3].y), t.lineTo(u[3].x, -h), t.lineTo(p[0].x, -h), t.lineTo(p[0].x, p[0].y), t[e(469)](), t.fillStyle = a.fillStyle || "#43b1f5", t.fill(), t.restore();
    }
    a[e(462)] && (t.fillStyle = a.color), this._paintText(t);
  }
  set width(t) {
    super.width = t, this._onAEChanged();
  }
  get width() {
    return this._width;
  }
  set height(t) {
    const e = S;
    super[e(461)] = t, this[e(470)]();
  }
  get height() {
    return this[S(480)];
  }
  destroy() {
    super[S(468)](), this.aeStatus = null;
  }
}
((n, t, e, i) => {
  for (var s, r = i > 1 ? void 0 : i ? dn(t, e) : t, a = n.length - 1; a >= 0; a--)
    (s = n[a]) && (r = (i ? s(t, e, r) : s(r)) || r);
  i && r && pn(t, e, r);
})([J("WaterLikeNode")], We[S(465)], "className", 2), z.regClass(S(476), "WaterLikeNode", We);
const R = kt;
function ie() {
  const n = ["foreground", "1iVBIEh", "arcsize", "toJson", "6KnUFKS", "stroke-width", "626381xsBVOn", "push", "1380228TcEXsX", "path", "attributes", "stroke-dasharray", "domToJson", "1721908NcFUgg", "24133750tCNIzM", "max", "domChildrenToJson", "parseFromString", "length", "sweep-flag", "background", "connections", "4307760VICKtL", "1282869ZyeOPP", "3294555hulSgD", "16BRHSZC"];
  return (ie = function() {
    return n;
  })();
}
function kt(n, t) {
  const e = ie();
  return (kt = function(i, s) {
    return e[i -= 394];
  })(n, t);
}
(function() {
  const n = kt, t = ie();
  for (; ; )
    try {
      if (-parseInt(n(400)) / 1 * (-parseInt(n(412)) / 2) + parseInt(n(397)) / 3 + parseInt(n(407)) / 4 + parseInt(n(395)) / 5 + parseInt(n(403)) / 6 * (parseInt(n(405)) / 7) + parseInt(n(398)) / 8 * (-parseInt(n(396)) / 9) + -parseInt(n(413)) / 10 === 556774)
        break;
      t.push(t.shift());
    } catch {
      t.push(t.shift());
    }
})();
class fn {
  constructor(t) {
    this.documentElement = this.textToElement(t);
  }
  textToElement(t) {
    const e = kt;
    return new DOMParser()[e(416)](t, "text/xml").documentElement;
  }
  [R(402)]() {
    const t = R, e = this.documentElement;
    let i = e.children, s = e.getAttribute("name");
    if (s == null)
      throw new Error("category is null");
    let r = [], a = { package: s, shapes: r };
    for (let o = 0; o < i[t(417)]; o++) {
      let l = i[o], h = l.getAttribute("name"), c = parseFloat(l.getAttribute("w")), p = parseFloat(l.getAttribute("h")), u = [], f = l.getElementsByTagName(t(394))[0];
      f != null && (u = this.domChildrenToJson(f, 1, 1));
      let d = this.parse(l.getElementsByTagName(t(419))[0], c, p), g = this.parse(l.getElementsByTagName("foreground")[0], c, p), m = { className: h, width: c, height: p };
      u[t(417)] > 0 && (m[t(394)] = u), d[t(417)] > 0 && (m.background = d), g.length > 0 && (m[t(399)] = g), r[t(406)](m);
    }
    return a;
  }
  domChildrenToJson(t, e, i) {
    const s = R;
    let r = t.children, a = [];
    for (let o = 0; o < r[s(417)]; o++) {
      let l = this.domToJson(r[o], e, i);
      a[s(406)](l);
    }
    return a;
  }
  [R(411)](t, e, i) {
    const s = R;
    let r = { T: t.tagName }, a = t[s(409)];
    for (let o = 0; o < a.length; o++) {
      let l = a[o], h = l.name, c = l.value;
      (h == "x" || h == "y" || h == "arcsize" || h == "w" || h == "h" || h == "x1" || h == "y1" || h == "x2" || h == "y2" || h == "x3" || h == "y3" || h == "cx" || h == "cy" || h == "limit" || h == "fontsize" || h == "x-axis-rotation" || h == "large-arc-flag" || h == s(418) || h == "r" || h == "rx" || h == "ry" || h == s(404) || h == s(410) || h == "stroke-dashoffset" || h == "stroke-linecap" || h == "stroke-linejoin" || h == "stroke-miterlimit" || h == "stroke-opacity" || h == s(404) || h == "stroke-dasharray") && (c = parseFloat(c)), r[h] = c;
    }
    return this.unitCmd(r, e, i), r;
  }
  parse(t, e, i) {
    const s = R;
    let r = [];
    if (t == null)
      return [];
    let a = t.children;
    for (let o = 0; o < a.length; o++) {
      let l = a[o];
      if (l.tagName == s(408)) {
        let h = this[s(415)](l, e, i);
        r[s(406)]({ T: "path", m: h });
      } else
        r.push(this.domToJson(l, e, i));
    }
    return r;
  }
  unitCmd(t, e, i) {
    const s = R;
    t.x != null && (t.x = t.x / e), t.y != null && (t.y = t.y / i), t.x1 != null && (t.x1 = t.x1 / e), t.y1 != null && (t.y1 = t.y1 / i), t.x2 != null && (t.x2 = t.x2 / e), t.y2 != null && (t.y2 = t.y2 / i), t.x3 != null && (t.x3 = t.x3 / e), t.y3 != null && (t.y3 = t.y3 / i), t.rx != null && (t.rx = t.rx / e), t.ry != null && (t.ry = t.ry / i), t.w != null && (t.w = t.w / e), t.h != null && (t.h = t.h / i), t.r != null && (t.r = t.r / Math.max(e, i)), t.arcsize != null && (t[s(401)] = t.arcsize / Math[s(414)](e, i));
  }
}
function wt(n, t) {
  const e = se();
  return (wt = function(i, s) {
    return e[i -= 326];
  })(n, t);
}
function se() {
  const n = ["ctx.textBaseline = '", "fill", "ctx.lineTo(", "linecap", "ctx.stroke(path2D)", "ctx.stroke(currPath);", "530LYATiU", "ctx.fill(currPath);", "ellipse", "color", "linejoin", "495GAFRSa", "strokeStyle", "close", "arcsize", "limit", "roundrect", "fillStyle", "290740SkjRfp", "beginPath", "fillstroke", "length", "fontcolor", "fontsize", "restore", "lineWidth", "miterlimit", "7tfYxOW", ' + "px sans-serif";', "3506ajlAGS", "1360614CjLJNe", "text", "width", "join", "ctx.miterLimit = '", "pathStr", "rect", "isClosed", "cap", 'let path2D = new Path2D("', "height", "getPathInfo", "bezierCurveTo", "sweep-flag", "ctx.fillText(", "3709216xeYDYB", "1001547pwWTWn", "61385gyVOlV", "curve", "ctx.moveTo(", "113223LDlLND", "save", "stroke", "16OuckpR", "push", "ctx.beginPath();", "path"];
  return (se = function() {
    return n;
  })();
}
(function() {
  const n = wt, t = se();
  for (; ; )
    try {
      if (parseInt(n(339)) / 1 + parseInt(n(350)) / 2 * (-parseInt(n(332)) / 3) + -parseInt(n(374)) / 4 * (-parseInt(n(368)) / 5) + -parseInt(n(351)) / 6 * (-parseInt(n(348)) / 7) + -parseInt(n(366)) / 8 + -parseInt(n(367)) / 9 + -parseInt(n(327)) / 10 * (-parseInt(n(371)) / 11) === 247966)
        break;
      t.push(t.shift());
    } catch {
      t.push(t.shift());
    }
})();
var U = re;
function re(n, t) {
  var e = oe();
  return (re = function(i, s) {
    return e[i -= 361];
  })(n, t);
}
(function() {
  for (var n = re, t = oe(); ; )
    try {
      if (-parseInt(n(370)) / 1 * (-parseInt(n(363)) / 2) + parseInt(n(373)) / 3 + -parseInt(n(367)) / 4 + parseInt(n(364)) / 5 + -parseInt(n(361)) / 6 + parseInt(n(372)) / 7 + -parseInt(n(369)) / 8 === 489120)
        break;
      t.push(t.shift());
    } catch {
      t.push(t.shift());
    }
})();
var gn = Object[U(365)], mn = Object.getOwnPropertyDescriptor;
const yn = new class {
  constructor() {
  }
  getPathInfo(n, t, e) {
    const i = wt;
    let s = "", r = !1;
    for (let a = 0; a < n[i(342)]; a++) {
      let o = n[a], l = o.T;
      l == "move" ? s += "M" + o.x * t + " " + o.y * e : l == "line" ? s += "L" + o.x * t + " " + o.y * e : l == "arc" ? s += "A" + o.rx * t + " " + o.ry * e + " " + o["x-axis-rotation"] + " " + o["large-arc-flag"] + " " + o[i(364)] + " " + o.x * t + " " + o.y * e : l == "curve" ? s += "C" + o.x1 * t + " " + o.y1 * e + " " + o.x2 * t + " " + o.y2 * e + " " + o.x3 * t + " " + o.y3 * e : l == "close" && (s += "Z", r = !0);
    }
    return { isClosed: r, pathStr: s };
  }
  drawPathArray(n, t, e = 1, i = 1, s = 1) {
    const r = wt;
    let a, o = null, l = null, h = e, c = i;
    for (let p = 0; p < t.length; p++) {
      let u = t[p], f = u.T;
      if (f == "path") {
        let d = this.getPathInfo(u.m, h, c);
        a = new Path2D(d[r(356)]), d[r(358)] && a.closePath();
      } else if (f == "move")
        o = u.x, l = u.y, n.moveTo(u.x * h, u.y * c);
      else if (f == r(334))
        n.closePath();
      else if (f == "line")
        o = u.x, l = u.y, n.lineTo(u.x * h, u.y * c);
      else if (f == "rect")
        n.beginPath(), u.x == null || n[r(357)](u.x * h, u.y * c, u.w * h, u.h * c);
      else if (f == "roundrect")
        n[r(340)](), u.x == null || n.roundRect(u.x * h, u.y * c, u.w * h, u.h * c, u[r(335)] * Math.max(h, c));
      else if (f == "circle")
        n.beginPath(), n.arc(u.cx * h, u.cy * c, u.r * Math.max(h, c), 0, 2 * Math.PI);
      else if (f == "ellipse")
        n.beginPath(), n[r(329)]((u.x + u.w / 2) * h, (u.y + u.h / 2) * c, u.w / 2 * h, u.h / 2 * c, 0, 0, 2 * Math.PI);
      else if (f == "arc") {
        let d = "M" + o * h + " " + l * c + " A" + u.rx * h + " " + u.ry * c + " " + u["x-axis-rotation"] + " " + u["large-arc-flag"] + " " + u["sweep-flag"] + " " + u.x * h + " " + u.y * c, g = new Path2D(d);
        s > 0 && n[r(373)](g), o = u.x, l = u.y;
      } else
        f == r(369) ? n[r(363)](u.x1 * h, u.y1 * c, u.x2 * h, u.y2 * c, u.x3 * h, u.y3 * c) : f == r(352) ? (n.textAlign = u.align, n.textBaseline = u.valign, n.fillText(u.str, u.x * h, u.y * c)) : f == "fontsize" ? n.font = "normal " + u.size + "px sans-serif" : f == r(343) ? n[r(338)] = u[r(330)] : f == "miterlimit" ? n.miterLimit = u[r(336)] : f == r(381) ? n.lineCap = u[r(359)] : f == r(331) ? n.linejoin = u[r(354)] : f == r(373) ? a != null ? (s > 0 && n.stroke(a), a = null) : s > 0 && n.stroke() : f == r(379) ? a != null ? (n.fill(a), a = null) : n.fill() : f == "strokewidth" ? n.lineWidth = u.width : f == "fillstroke" ? a != null ? (n[r(379)](a), s > 0 && n.stroke(a), a = null) : (n.fill(), s > 0 && n.stroke()) : f == "strokecolor" ? n[r(333)] = u.color : f == "fillcolor" ? n.fillStyle = u[r(330)] : f == r(372) ? n.save() : f == r(345) && n.restore();
    }
  }
}();
function oe() {
  var n = ["3316915oPRYdG", "defineProperty", "className", "936380sAxJhy", "draw", "14772792tWWbkl", "8644XOZTyZ", "regClass", "6549319iyeEMW", "1676982qUrfkr", "length", "_pathArray", "1574472mfevTc", "variable", "156pcLLRA"];
  return (oe = function() {
    return n;
  })();
}
class Ft extends tn {
  constructor() {
    var t = U;
    super(), this.aspect = t(362);
  }
  [U(368)](t, e) {
    var i = U;
    if (this[i(375)] == null)
      return;
    let s = e.getComputedStyle().lineWidth, r = e._drawContentDesc.shapeSize, a = 0.5 * -r.width, o = 0.5 * -r.height;
    t.save(), t.translate(a, o), yn.drawPathArray(t, this[i(375)], r.width, r.height, s), t.restore();
  }
}
function bt(n, t) {
  const e = ae();
  return (bt = function(i, s) {
    return e[i -= 353];
  })(n, t);
}
function ae() {
  const n = ["9206208CEvYHx", "46011EbZjKh", "background", "11517165Sgdeei", "regShape", "4yIfzfQ", "concat", "className", "308466LDGFfj", "541228SPfrAV", "15CYEPmz", "toJson", "height", "56YEKveG", "shapes", "usage", "connections", "4494AvMbpO", "CONNECT_EDIT", "2993680IuuGkP", "_pathArray", "796QvYofS"];
  return (ae = function() {
    return n;
  })();
}
((n, t, e, i) => {
  for (var s, r = U, a = i > 1 ? void 0 : i ? mn(t, e) : t, o = n[r(374)] - 1; o >= 0; o--)
    (s = n[o]) && (a = (i ? s(t, e, a) : s(a)) || a);
  i && a && gn(t, e, a);
})([J("XMLShape")], Ft.prototype, U(366), 2), z[U(371)]("com.jtopo.extensions", "XMLShape", Ft), function() {
  const n = bt, t = ae();
  for (; ; )
    try {
      if (parseInt(n(356)) / 1 * (-parseInt(n(360)) / 2) + parseInt(n(368)) / 3 * (parseInt(n(372)) / 4) + -parseInt(n(361)) / 5 * (parseInt(n(359)) / 6) + -parseInt(n(374)) / 7 * (-parseInt(n(364)) / 8) + parseInt(n(373)) / 9 + -parseInt(n(370)) / 10 + parseInt(n(354)) / 11 === 877983)
        break;
      t.push(t.shift());
    } catch {
      t.push(t.shift());
    }
}();
const zn = { fromXml: function(n) {
  const t = bt;
  let e = new fn(n)[t(362)]();
  return e[t(365)].map((i) => {
    const s = t;
    let r = function(a, o) {
      const l = bt;
      let h = new Ft();
      h.width = o.width, h.height = o[l(363)], h.namespace = a + "." + o.className;
      let c = [], p = o[l(353)];
      p && (c = c[l(357)](p));
      let u = o.foreground;
      return u && (c = c.concat(u)), h[l(371)] = c, o[l(367)] && (o.connections.forEach((f) => {
        const d = l;
        f.x = 2 * f.x - 1, f.y = 2 * f.y - 1, f.usage = f[d(366)] || en[d(369)];
      }), h.setConnections(o.connections)), h;
    }(e.package, i);
    return z[s(355)](e.package, i[s(358)], r), r;
  });
} }, _ = Y;
function le() {
  const n = ["RatioNode", "2838140dHbuVn", "103722QEBqgX", "10rZEHXM", "left", "645798dWwOGT", "469xXvcCr", "setAttribute", "111104ASAnRl", "5490YIQqjn", "ratio", "prototype", "length", "setAttributes", "567641okPLgd", "12AuHXQt", "direction", "8967684amjLSB", "fillStyle", "10976WyNtBd", "getAttribute"];
  return (le = function() {
    return n;
  })();
}
(function() {
  const n = Y, t = le();
  for (; ; )
    try {
      if (-parseInt(n(115)) / 1 + parseInt(n(127)) / 2 * (-parseInt(n(116)) / 3) + parseInt(n(109)) / 4 * (parseInt(n(125)) / 5) + parseInt(n(124)) / 6 * (parseInt(n(128)) / 7) + parseInt(n(120)) / 8 * (parseInt(n(110)) / 9) + -parseInt(n(123)) / 10 + parseInt(n(118)) / 11 === 722894)
        break;
      t.push(t.shift());
    } catch {
      t.push(t.shift());
    }
})();
var xn = Object.defineProperty, wn = Object.getOwnPropertyDescriptor;
function Y(n, t) {
  const e = le();
  return (Y = function(i, s) {
    return e[i -= 109];
  })(n, t);
}
class Rt extends Ut {
  constructor(t, e = 0, i = 0, s = 1, r = 1) {
    const a = Y;
    super(t, e, i, s, r), this[a(114)]({ ratio: 0.5, direction: "right" });
  }
  drawShape(t) {
    const e = Y;
    let i = this;
    const s = this.width, r = this.height;
    let a = i.getAttribute(e(111)), o = i[e(121)]("direction"), l = i.getComputedStyle();
    l.fillStyle && (t[e(119)] = l[e(119)]);
    let h = l.borderWidth || 0, c = l.padding || 0, p = 2 * c + 2 * h, u = 0.5 * -s + h + c, f = 0.5 * -r + h + c, d = (s - p) * a, g = (r - p) * a;
    if (o == "right")
      g = r - p;
    else if (o == "down")
      d = s - p;
    else if (o == e(126))
      u = 0.5 * -s + s - h - c - d, g = r - p;
    else {
      if (o != "up")
        throw new Error("Unknow direction:" + o);
      f = 0.5 * -r + r - h - c - g, d = s - p;
    }
    t.beginPath(), t.rect(u, f, d, g), t.fill();
  }
}
function A(n, t) {
  var e = he();
  return (A = function(i, s) {
    return e[i -= 322];
  })(n, t);
}
((n, t, e, i) => {
  const s = Y;
  for (var r, a = i > 1 ? void 0 : i ? wn(t, e) : t, o = n[s(113)] - 1; o >= 0; o--)
    (r = n[o]) && (a = (i ? r(t, e, a) : r(a)) || a);
  i && a && xn(t, e, a);
})([J(_(122))], Rt[_(112)], "className", 2), Object.defineProperties(Rt[_(112)], { ratio: { set(n) {
  const t = _;
  this.setAttribute(t(111), n);
}, get() {
  const n = _;
  return this[n(121)](n(111));
} }, direction: { set(n) {
  this[_(129)]("direction", n);
}, get() {
  const n = _;
  return this.getAttribute(n(117));
} } }), z.regClass("com.jtopo.extensions", _(122), Rt);
var bn = A;
function he() {
  var n = ["split", "24QPDsJu", "charCodeAt", "stop", "decodeAndBlitFrameRGBA", "framenum", "21hEpfku", "fill", "delay", "data", "then", "pixelsArray", "get", "3395441ArrYdZ", "5468JzMQcC", "stoped", "4329585XtQPWZ", "5687eleRPP", "play", "6xUKcAV", "9tmmPls", "62qnjXKN", "6887xSkGyy", "url", "loopRender", "imageData", "match", "frameInfo", "6629032KYeGKI", "2716390yhvsmN", "width", "length", "now", "call", "height"];
  return (he = function() {
    return n;
  })();
}
(function() {
  for (var n = A, t = he(); ; )
    try {
      if (parseInt(n(351)) / 1 * (parseInt(n(350)) / 2) + -parseInt(n(335)) / 3 * (parseInt(n(343)) / 4) + parseInt(n(345)) / 5 * (parseInt(n(348)) / 6) + parseInt(n(342)) / 7 + -parseInt(n(322)) / 8 * (parseInt(n(349)) / 9) + -parseInt(n(323)) / 10 + parseInt(n(346)) / 11 * (-parseInt(n(330)) / 12) === 453606)
        break;
      t.push(t.shift());
    } catch {
      t.push(t.shift());
    }
})(), (function() {
  var n = A;
  const t = self, e = /* @__PURE__ */ new Map(), i = { load: function(o) {
    var l = A;
    const h = o.basePath, c = o.url;
    if (c.startsWith("data:image/gif")) {
      const p = c[l(329)](",")[1], u = atob(p), f = new Uint8Array(u.length);
      for (let m = 0; m < u[l(325)]; m++)
        f[m] = u[l(331)](m);
      const d = f.buffer;
      let g = new r(c, d);
      e.set(c, g);
    } else
      fetch(new URL(o.url, h).href)[l(339)]((p) => {
        if (!p.ok)
          throw new Error("HTTP status:" + p.status);
        return p.arrayBuffer();
      }).then((p) => {
        let u = new r(c, p);
        e.set(c, u);
      }).catch((p) => {
        s.call("onError", { url: c });
      });
  }, stop: function(o) {
    var l = A;
    let h = e[l(341)](o.url);
    h != null && h[l(332)]();
  }, play: function(o) {
    var l = A;
    let h = e.get(o[l(352)]);
    h != null && h.play();
  } }, s = { call: function(o, l) {
    var h = A;
    t.postMessage({ method: o, args: l, time: Date[h(326)]() });
  } };
  t.onmessage = function(o) {
    let l = o[A(338)].method, h = o.data.args;
    i[l].call(i, h);
  };
  class r {
    constructor(l, h) {
      var c = A;
      this.totalFrames = 0, this[c(334)] = 0, this.stoped = !0, this.url = l;
      var p = new a(new Uint8Array(h));
      this.imageData = new Uint8ClampedArray(p.width * p[c(328)] * 4), this.totalFrames = p.numFrames(), this.gr = p, s.call("onLoad", { url: l, width: p.width, height: p.height }), this[c(353)]();
    }
    stop() {
      this[A(344)] = !0;
    }
    [n(347)]() {
      this[n(344)] = !1;
    }
    loopRender() {
      var l = n;
      const h = this, c = this.gr;
      var p = this[l(334)] % this.totalFrames, u = c[l(356)](p);
      !this.stoped && ((p === 0 || u.disposal === 2) && this[l(354)][l(336)](0), c[l(333)](p, this.imageData), s[l(327)]("draw", { url: this[l(352)], width: c[l(324)], height: c[l(328)], pixes: this.imageData })), setTimeout(() => {
        h.loopRender(), h.framenum++;
      }, 10 * u[l(337)]);
    }
  }
  function a(o) {
    var l = 0;
    if (o[l++] !== 71 || o[l++] !== 73 || o[l++] !== 70 || o[l++] !== 56 || (o[l++] + 1 & 253) != 56 || o[l++] !== 97)
      throw new Error("Invalid GIF 87a/89a header.");
    var h = o[l++] | o[l++] << 8, c = o[l++] | o[l++] << 8, p = o[l++], u = p >> 7, f = 1 << (7 & p) + 1;
    o[l++], o[l++];
    var d = null, g = null;
    u && (d = l, g = f, l += 3 * f);
    var m = !0, v = [], E = 0, G = null, we = 0, be = null;
    for (this.width = h, this.height = c; m && l < o.length; )
      switch (o[l++]) {
        case 33:
          switch (o[l++]) {
            case 255:
              if (o[l] !== 11 || o[l + 1] == 78 && o[l + 2] == 69 && o[l + 3] == 84 && o[l + 4] == 83 && o[l + 5] == 67 && o[l + 6] == 65 && o[l + 7] == 80 && o[l + 8] == 69 && o[l + 9] == 50 && o[l + 10] == 46 && o[l + 11] == 48 && o[l + 12] == 3 && o[l + 13] == 1 && o[l + 16] == 0)
                l += 14, be = o[l++] | o[l++] << 8, l++;
              else
                for (l += 12; ; ) {
                  if (!((T = o[l++]) >= 0))
                    throw Error("Invalid block size");
                  if (T === 0)
                    break;
                  l += T;
                }
              break;
            case 249:
              if (o[l++] !== 4 || o[l + 4] !== 0)
                throw new Error("Invalid graphics extension block.");
              var ve = o[l++];
              E = o[l++] | o[l++] << 8, G = o[l++], 1 & ve || (G = null), we = ve >> 2 & 7, l++;
              break;
            case 1:
            case 254:
              for (; ; ) {
                if (!((T = o[l++]) >= 0))
                  throw Error("Invalid block size");
                if (T === 0)
                  break;
                l += T;
              }
              break;
            default:
              throw new Error("Unknown graphic control label: 0x" + o[l - 1].toString(16));
          }
          break;
        case 44:
          var Fe = o[l++] | o[l++] << 8, qe = o[l++] | o[l++] << 8, Ie = o[l++] | o[l++] << 8, ke = o[l++] | o[l++] << 8, Mt = o[l++], Ue = Mt >> 6 & 1, Ee = 1 << (7 & Mt) + 1, Me = d, Ae = g, Le = !1;
          Mt >> 7 && (Le = !0, Me = l, Ae = Ee, l += 3 * Ee);
          var Ce = l;
          for (l++; ; ) {
            var T;
            if (!((T = o[l++]) >= 0))
              throw Error("Invalid block size");
            if (T === 0)
              break;
            l += T;
          }
          v.push({ x: Fe, y: qe, width: Ie, height: ke, has_local_palette: Le, palette_offset: Me, palette_size: Ae, data_offset: Ce, data_length: l - Ce, transparent_index: G, interlaced: !!Ue, delay: E, disposal: we, pixelsArray: new Uint8Array(Ie * ke) });
          break;
        case 59:
          m = !1;
          break;
        default:
          throw new Error("Unknown gif block: 0x" + o[l - 1].toString(16));
      }
    this.numFrames = function() {
      return v.length;
    }, this.loopCount = function() {
      return be;
    }, this.frameInfo = function(X) {
      if (X < 0 || X >= v.length)
        throw new Error("Frame index out of range.");
      return v[X];
    }, this.decodeAndBlitFrameRGBA = function(X, ht) {
      var At = A, M = this.frameInfo(X), Je = M[At(324)] * M.height, ct = M[At(340)];
      ct.fill(0), function(dt, ft, _t, Te) {
        for (var Nt = dt[ft++], Wt = 1 << Nt, zt = Wt + 1, V = zt + 1, H = Nt + 1, Z = (1 << H) - 1, K = 0, Dt = 0, $ = 0, gt = dt[ft++], Ht = new Int32Array(4096), tt = null; ; ) {
          for (; K < 16 && gt !== 0; )
            Dt |= dt[ft++] << K, K += 8, gt === 1 ? gt = dt[ft++] : --gt;
          if (K < H)
            break;
          var B = Dt & Z;
          if (Dt >>= H, K -= H, B !== Wt) {
            if (B === zt)
              break;
            for (var mt = B < V ? B : tt, yt = 0, O = mt; O > Wt; )
              O = Ht[O] >> 8, ++yt;
            var Bt = O;
            if ($ + yt + (mt !== B ? 1 : 0) > Te)
              return void console.log("Warning, gif stream longer than expected.");
            _t[$++] = Bt;
            var Ze = $ += yt;
            for (mt !== B && (_t[$++] = Bt), O = mt; yt--; )
              O = Ht[O], _t[--Ze] = 255 & O, O >>= 8;
            tt !== null && V < 4096 && (Ht[V++] = tt << 8 | Bt, V >= Z + 1 && H < 12 && (++H, Z = Z << 1 | 1)), tt = B;
          } else
            V = zt + 1, Z = (1 << (H = Nt + 1)) - 1, tt = null;
        }
        $ !== Te && console.log("Warning, gif stream shorter than expected.");
      }(o, M.data_offset, ct, Je);
      var Lt = M.palette_offset, Ct = M.transparent_index;
      Ct === null && (Ct = 256);
      var ut = M.width, St = h - ut, Tt = ut, Se = 4 * (M.y * h + M.x), Qe = 4 * ((M.y + M.height) * h + M.x), D = Se, Ot = 4 * St;
      M.interlaced === !0 && (Ot += 4 * h * 7);
      for (var jt = 8, Pt = 0, Ye = ct[At(325)]; Pt < Ye; ++Pt) {
        var pt = ct[Pt];
        if (Tt === 0 && (Tt = ut, (D += Ot) >= Qe && (Ot = 4 * St + 4 * h * (jt - 1), D = Se + (ut + St) * (jt << 1), jt >>= 1)), pt === Ct)
          D += 4;
        else {
          var Ge = o[Lt + 3 * pt], Xe = o[Lt + 3 * pt + 1], Ve = o[Lt + 3 * pt + 2];
          ht[D++] = Ge, ht[D++] = Xe, ht[D++] = Ve, ht[D++] = 255;
        }
        --Tt;
      }
    };
  }
}).toString()[bn(355)](/\{([\s\S]*?)\}$/);
const L = Et;
function ce() {
  const n = ["24DxyOsH", "get", "hasNode", "canvasCache", "pixes", "1900577nVORkL", "nodeSetMap", "449218jjTdeQ", "getCanvas", "postMessage", "size", "ctx", "2472ZJvTsG", "url", "onmessage", "2340345tRpNdy", "74850VwgWyk", "worker", "height", "putImageData", "4145396quJNna", "imageSrc", "150sYjSEO", "stop", "load", "play", "40077CKVyrJ", "2522352hwEphN", "delete", "init", "3qbknNf", "update", "width"];
  return (ce = function() {
    return n;
  })();
}
function Et(n, t) {
  const e = ce();
  return (Et = function(i, s) {
    return e[i -= 469];
  })(n, t);
}
(function() {
  const n = Et, t = ce();
  for (; ; )
    try {
      if (parseInt(n(481)) / 1 + parseInt(n(492)) / 2 + -parseInt(n(495)) / 3 * (parseInt(n(485)) / 4) + -parseInt(n(480)) / 5 + parseInt(n(498)) / 6 * (-parseInt(n(470)) / 7) + parseInt(n(477)) / 8 * (parseInt(n(491)) / 9) + -parseInt(n(487)) / 10 * (-parseInt(n(472)) / 11) === 734111)
        break;
      t.push(t.shift());
    } catch {
      t.push(t.shift());
    }
})();
class vn extends ot {
  constructor() {
    const t = Et;
    super(), this.canvasCache = /* @__PURE__ */ new Map(), this.nodeSetMap = /* @__PURE__ */ new Map(), this[t(494)]();
  }
  [L(473)](t) {
    const e = L;
    let i = this[e(501)].get(t[e(486)]);
    return i == null ? null : i.canvas;
  }
  addNode(t) {
    const e = L;
    let i = t.imageSrc, s = e(490), r = this[e(471)].get(i);
    r == null && (r = /* @__PURE__ */ new Set(), this.nodeSetMap.set(i, r), s = e(489)), r.add(t), s == "load" ? this[e(482)].postMessage({ method: s, args: { url: i, basePath: location.href } }) : this.play(i);
  }
  [L(500)](t) {
    const e = L;
    let i = this.nodeSetMap.get(t[e(486)]);
    return i != null && i.has(t);
  }
  removeNode(t) {
    const e = L;
    let i = t.imageSrc, s = this.nodeSetMap.get(i);
    s != null && s[e(475)] != 0 && (s[e(493)](t), s.size == 0 && this[e(488)](i));
  }
  play(t) {
    this.worker.postMessage({ method: "play", args: { url: t } });
  }
  stop(t) {
    const e = L;
    this.worker[e(474)]({ method: e(488), args: { url: t } });
  }
  onDraw(t) {
    const e = L;
    let i = this[e(471)][e(499)](t);
    if (i != null && i.size != 0)
      for (let s of i)
        s[e(496)]();
  }
  [L(494)]() {
    const t = L, e = this, i = new Blob(['function o(t){var e=0;if(71!==t[e++]||73!==t[e++]||70!==t[e++]||56!==t[e++]||56!=(t[e++]+1&253)||97!==t[e++])throw new Error("Invalid GIF 87a/89a header.");var r=t[e++]|t[e++]<<8,a=t[e++]|t[e++]<<8,n=t[e++],i=n>>7,l=1<<1+(7&n);t[e++],t[e++];var o=null,s=null;i&&(o=e,s=l,e+=3*l);var h=!0,f=[],d=0,c=null,u=0,g=null;for(this.width=r,this.height=a;h&&e<t.length;)switch(t[e++]){case 33:switch(t[e++]){case 255:if(11!==t[e]||78==t[e+1]&&69==t[e+2]&&84==t[e+3]&&83==t[e+4]&&67==t[e+5]&&65==t[e+6]&&80==t[e+7]&&69==t[e+8]&&50==t[e+9]&&46==t[e+10]&&48==t[e+11]&&3==t[e+12]&&1==t[e+13]&&0==t[e+16])e+=14,g=t[e++]|t[e++]<<8,e++;else for(e+=12;;){if(!((F=t[e++])>=0))throw Error("Invalid block size");if(0===F)break;e+=F}break;case 249:if(4!==t[e++]||0!==t[e+4])throw new Error("Invalid graphics extension block.");var w=t[e++];d=t[e++]|t[e++]<<8,c=t[e++],1&w||(c=null),u=w>>2&7,e++;break;case 1:case 254:for(;;){if(!((F=t[e++])>=0))throw Error("Invalid block size");if(0===F)break;e+=F}break;default:throw new Error("Unknown graphic control label: 0x"+t[e-1].toString(16))}break;case 44:var p=t[e++]|t[e++]<<8,m=t[e++]|t[e++]<<8,v=t[e++]|t[e++]<<8,b=t[e++]|t[e++]<<8,k=t[e++],y=k>>6&1,x=1<<1+(7&k),A=o,E=s,I=!1;k>>7&&(I=!0,A=e,E=x,e+=3*x);var _=e;for(e++;;){var F;if(!((F=t[e++])>=0))throw Error("Invalid block size");if(0===F)break;e+=F}f.push({x:p,y:m,width:v,height:b,has_local_palette:I,palette_offset:A,palette_size:E,data_offset:_,data_length:e-_,transparent_index:c,interlaced:!!y,delay:d,disposal:u,pixelsArray:new Uint8Array(v*b)});break;case 59:h=!1;break;default:throw new Error("Unknown gif block: 0x"+t[e-1].toString(16))}this.numFrames=function(){return f.length},this.loopCount=function(){return g},this.frameInfo=function(t){if(t<0||t>=f.length)throw new Error("Frame index out of range.");return f[t]},this.decodeAndBlitFrameRGBA=function(e,a){var n=this.frameInfo(e),i=n.width*n.height,l=n.pixelsArray;l.fill(0),function(t,e,r,a){for(var n=t[e++],i=1<<n,l=i+1,o=l+1,s=n+1,h=(1<<s)-1,f=0,d=0,c=0,u=t[e++],g=new Int32Array(4096),w=null;;){for(;f<16&&0!==u;)d|=t[e++]<<f,f+=8,1===u?u=t[e++]:--u;if(f<s)break;var p=d&h;if(d>>=s,f-=s,p!==i){if(p===l)break;for(var m=p<o?p:w,v=0,b=m;b>i;)b=g[b]>>8,++v;var k=b;if(c+v+(m!==p?1:0)>a)return void console.log("Warning, gif stream longer than expected.");r[c++]=k;var y=c+=v;for(m!==p&&(r[c++]=k),b=m;v--;)b=g[b],r[--y]=255&b,b>>=8;null!==w&&o<4096&&(g[o++]=w<<8|k,o>=h+1&&s<12&&(++s,h=h<<1|1)),w=p}else o=l+1,h=(1<<(s=n+1))-1,w=null}c!==a&&console.log("Warning, gif stream shorter than expected.")}(t,n.data_offset,l,i);var o=n.palette_offset,s=n.transparent_index;null===s&&(s=256);var h=n.width,f=r-h,d=h,c=4*(n.y*r+n.x),u=4*((n.y+n.height)*r+n.x),g=c,w=4*f;!0===n.interlaced&&(w+=4*r*7);for(var p=8,m=0,v=l.length;m<v;++m){var b=l[m];if(0===d&&(d=h,(g+=w)>=u&&(w=4*f+4*r*(p-1),g=c+(h+f)*(p<<1),p>>=1)),b===s)g+=4;else{var k=t[o+3*b],y=t[o+3*b+1],x=t[o+3*b+2];a[g++]=k,a[g++]=y,a[g++]=x,a[g++]=255}--d}}}const l=self,e=new Map,i={load:function(t){const r=t.basePath,i=t.url;if(i.startsWith("data:image/gif")){const t=i.split(",")[1],r=atob(t),n=new Uint8Array(r.length);for(let t=0;t<r.length;t++)n[t]=r.charCodeAt(t);const l=n.buffer;let o=new a(i,l);e.set(i,o)}else fetch(new URL(t.url,r).href).then(t=>{if(!t.ok)throw new Error("HTTP status:"+t.status);return t.arrayBuffer()}).then(t=>{let r=new a(i,t);e.set(i,r)}).catch(t=>{n.call("onError",{url:i})})},stop:function(t){let r=e.get(t.url);null!=r&&r.stop()},play:function(t){let r=e.get(t.url);null!=r&&r.play()}},n={call:function(t,e){l.postMessage({method:t,args:e,time:Date.now()})}};l.onmessage=function(t){let e=t.data.method,r=t.data.args;i[e].call(i,r)};class a{constructor(t,e){this.totalFrames=0,this.framenum=0,this.stoped=!0,this.url=t;var r=new o(new Uint8Array(e));this.imageData=new Uint8ClampedArray(r.width*r.height*4),this.totalFrames=r.numFrames(),this.gr=r,n.call("onLoad",{url:t,width:r.width,height:r.height}),this.loopRender()}stop(){this.stoped=!0}play(){this.stoped=!1}loopRender(){const t=this,e=this.gr;var r=this.framenum%this.totalFrames,a=e.frameInfo(r);this.stoped||(0!==r&&2!==a.disposal||this.imageData.fill(0),e.decodeAndBlitFrameRGBA(r,this.imageData),n.call("draw",{url:this.url,width:e.width,height:e.height,pixes:this.imageData})),setTimeout(()=>{t.loopRender(),t.framenum++},10*a.delay)}}'], { type: "application/javascript" }), s = new Worker(URL.createObjectURL(i));
    this.worker = s;
    const r = this[t(501)], a = { onLoad(o) {
      const l = t;
      let h = new ImageData(o.width, o[l(483)]), c = document.createElement("canvas");
      c[l(497)] = o[l(497)], c[l(483)] = o[l(483)];
      let p = c.getContext("2d"), u = { canvas: c, ctx: p, imageData: h };
      r.set(o.url, u), e.play(o.url);
    }, draw(o) {
      const l = t;
      let h = r.get(o[l(478)]), c = h.imageData;
      c.data.set(o[l(469)]), h[l(476)][l(484)](c, 0, 0), e.onDraw(o.url);
    }, onError(o) {
    } };
    s[t(479)] = function(o) {
      let l = o.data, h = l.method, c = l.args;
      l.time, a[h].call(a, c);
    };
  }
}
const xt = new vn();
var W = ue;
(function() {
  for (var n = ue, t = pe(); ; )
    try {
      if (-parseInt(n(185)) / 1 * (parseInt(n(200)) / 2) + parseInt(n(196)) / 3 * (-parseInt(n(193)) / 4) + parseInt(n(198)) / 5 + -parseInt(n(203)) / 6 + -parseInt(n(204)) / 7 * (-parseInt(n(205)) / 8) + parseInt(n(199)) / 9 * (-parseInt(n(183)) / 10) + parseInt(n(194)) / 11 * (parseInt(n(190)) / 12) === 767180)
        break;
      t.push(t.shift());
    } catch {
      t.push(t.shift());
    }
})();
var In = Object[W(181)], kn = Object[W(188)];
function ue(n, t) {
  var e = pe();
  return (ue = function(i, s) {
    return e[i -= 181];
  })(n, t);
}
function pe() {
  var n = ["4257340MohRji", "999ImclqC", "1218fwqzdq", "imageObject", "height", "7815132nxVyLS", "13342VGtHFE", "4352DnJPVx", "defineProperty", "width", "108130ObjfyW", "imageSrc", "869zEJRlu", "GifNode", "removeFromParent", "getOwnPropertyDescriptor", "regClass", "1812OTGyDm", "com.jtopo.extensions", "length", "59316YzNSmI", "194293QvalZa", "endsWith", "153jqRbJk", ".gif"];
  return (pe = function() {
    return n;
  })();
}
class ze extends nn {
  constructor(t, e = 0, i = 0, s = 1, r = 1) {
    super(t, e, i, s, r);
  }
  _drawImage(t, e) {
    var i = W;
    if (xt.hasNode(this)) {
      let s = xt.getCanvas(this);
      if (s != null)
        return void t.drawImage(s, 0.5 * -this.width, 0.5 * -this.height, this.width, this[i(202)]);
    } else
      this[i(201)] != null && (this.imageSrc[i(195)](i(197)) || this[i(184)].startsWith("data:image/gif")) && xt.addNode(this);
    t.drawImage(e, 0.5 * -this.width, 0.5 * -this[i(202)], this[i(182)], this.height);
  }
  removeFromParent() {
    return super[W(187)](), xt.removeNode(this), this;
  }
}
((n, t, e, i) => {
  for (var s, r = W, a = i > 1 ? void 0 : i ? kn(t, e) : t, o = n[r(192)] - 1; o >= 0; o--)
    (s = n[o]) && (a = (i ? s(t, e, a) : s(a)) || a);
  i && a && In(t, e, a);
})([J(W(186))], ze.prototype, "className", 2), z[W(189)](W(191), "GifNode", ze);
const y = de;
(function() {
  const n = de, t = fe();
  for (; ; )
    try {
      if (parseInt(n(410)) / 1 * (-parseInt(n(399)) / 2) + -parseInt(n(416)) / 3 * (parseInt(n(417)) / 4) + parseInt(n(426)) / 5 * (parseInt(n(396)) / 6) + -parseInt(n(423)) / 7 * (-parseInt(n(403)) / 8) + -parseInt(n(419)) / 9 * (-parseInt(n(404)) / 10) + parseInt(n(425)) / 11 * (parseInt(n(420)) / 12) + parseInt(n(398)) / 13 === 865413)
        break;
      t.push(t.shift());
    } catch {
      t.push(t.shift());
    }
})();
const k = { forward: y(401), back: "back", moveTo: "moveTo", mark: "mark", turn: "turn", turnLeft: y(408), turnRight: "turnRight", faceTo: y(397), faceToMark: y(418) };
function de(n, t) {
  const e = fe();
  return (de = function(i, s) {
    return e[i -= 393];
  })(n, t);
}
let En = Object.keys(k);
class lt extends De {
  constructor(t, e) {
    super(t, e);
  }
}
const vt = {};
En.forEach((n) => {
  vt[n] = new lt(n);
});
let Mn = new lt(y(401)), An = new lt("back"), Ln = new lt(y(415));
function fe() {
  const n = ["number", "258629oOHMbl", "back", "77IWuvpL", "5yjphOM", "direction", "args", "object", "1010976McoqWI", "faceTo", "13185575pOdVnc", "101586Pecdya", "moveTo", "forward", "dispatchEvent", "200OIyBDY", "868170UXALNu", "atan2", "hasListener", "removeMark", "turnLeft", "onPositionChanged", "19JdzgAs", "marks", "mark's name is required.", "mark", "getMark", "turn", "1410qTRKDp", "12044CPoqTP", "faceToMark", "9jilGEf", "1804092yQNqvt", "turnTo"];
  return (fe = function() {
    return n;
  })();
}
class Cn {
  constructor(t, e, i) {
    this.x = t, this.y = e, this.direction = i;
  }
}
class Sn extends ot {
  constructor() {
    super(), this._x = 0, this._y = 0, this._direction = 0, this.reset();
  }
  onPositionChanged() {
  }
  onDirectionChanged() {
  }
  reset() {
    const t = y;
    return this.x = 0, this.y = 0, this[t(393)] = 0, this.removeAllMarks(), this;
  }
  [y(400)](t, e) {
    const i = y;
    return typeof t === i(422) && typeof e === i(422) ? (this.x = t, this.y = e) : typeof t == "object" && (this.x = t.x, this.y = t.y), this[i(406)](k.moveTo) && this[i(402)](new lt(k.moveTo, { target: this, args: [t, e] })), this;
  }
  forward(t) {
    const e = y;
    return this.x += t * Math.cos(this.direction), this.y += t * Math.sin(this[e(393)]), this.hasListener(k[e(401)]) && this[e(402)](Mn), this;
  }
  [y(424)](t) {
    const e = y;
    this.forward(-t), this[e(406)](k.back) && this.dispatchEvent(An);
  }
  turnTo(t) {
    const e = y;
    return this.direction = t, this.hasListener(k.turn) && this[e(402)](Ln), this;
  }
  turn(t) {
    return this.turnTo(this.direction + t);
  }
  turnLeft(t = Math.PI / 2) {
    return this[y(421)](this.direction - t);
  }
  turnRight(t = Math.PI / 2) {
    return this[y(421)](this.direction + t);
  }
  faceTo(t, e) {
    const i = y;
    let s;
    typeof t === i(422) && typeof e === i(422) ? s = t : typeof t === i(395) && (s = t.x, e = t.y);
    let r = Math[i(405)](e - this.y, s - this.x);
    if (this.direction = r, this.hasListener(k[i(397)])) {
      let a = vt[k.faceTo];
      a[i(394)] = arguments[0], this[i(402)](a);
    }
    return this;
  }
  mark(t) {
    const e = y;
    if (t == null)
      throw new Error(e(412));
    if (this[e(411)][t] = new Cn(this.x, this.y, this.direction), this.hasListener(k[e(413)])) {
      let i = vt[k[e(413)]];
      i.args = t, this[e(402)](i);
    }
    return this;
  }
  hasMark(t) {
    return this.marks[t] != null;
  }
  getMark(t) {
    let e = this[y(411)][t];
    if (e == null)
      throw new Error("mark '" + t + "' not found.");
    return e;
  }
  moveToMark(t) {
    let e = this[y(414)](t);
    return this.moveTo(e.x, e.y), this;
  }
  restoreToMark(t) {
    let e = this.getMark(t);
    return this.moveTo(e.x, e.y), this.turnTo(e.direction), this;
  }
  removeAllMarks() {
    this.marks = {};
  }
  [y(407)](t) {
    const e = y;
    return !!this.hasMark(t) && (delete this[e(411)][t], !0);
  }
  getMarks() {
    return this[y(411)];
  }
  addMarks(t) {
    for (let e in t)
      this.marks[e] = t[e];
  }
  get x() {
    return this._x;
  }
  set x(t) {
    const e = y;
    t != this._x && (this._x = t, this[e(409)]());
  }
  get y() {
    return this._y;
  }
  set y(t) {
    t != this._y && (this._y = t, this.onPositionChanged());
  }
  get direction() {
    return this._direction;
  }
  set [y(393)](t) {
    t != this._direction && (this._direction = t, this.onDirectionChanged());
  }
}
function ge() {
  const n = ["setAttributes", "forward", "turnLeft", "faceToMark", "cancel", "faceTo", "atan2", "turnTo", "187OwKgPX", "254890pCskpk", "1181388CHFsdN", "1718845QiJTfO", "6RcsTiJ", "setTopoAnimationOptions", "moveTo", "play", "49BeHFPg", "defaultAnimationOptions", "367120jLojJY", "4474017FxIjHd", "1952253bNQACu", "direction", "_anime", "57634RTvGNO", "number", "getMark", "turn", "duration", "8DHpqsH", "restoreToMark"];
  return (ge = function() {
    return n;
  })();
}
const w = me;
function me(n, t) {
  const e = ge();
  return (me = function(i, s) {
    return e[i -= 421];
  })(n, t);
}
(function() {
  const n = me, t = ge();
  for (; ; )
    try {
      if (-parseInt(n(437)) / 1 * (parseInt(n(442)) / 2) + parseInt(n(434)) / 3 + parseInt(n(424)) / 4 + parseInt(n(425)) / 5 * (parseInt(n(426)) / 6) + -parseInt(n(430)) / 7 * (-parseInt(n(432)) / 8) + -parseInt(n(433)) / 9 + -parseInt(n(423)) / 10 * (parseInt(n(422)) / 11) === 450135)
        break;
      t.push(t.shift());
    } catch {
      t.push(t.shift());
    }
})();
class Tn {
  constructor(t) {
    this.defaultDuration = 1e3, this.defaultEffect = "easeLinear", this.defaultAnimationOptions = { duration: 1e3, effect: "easeLinear" }, this.topo = t, this.animation = new N();
  }
  [w(427)](t) {
    const e = w;
    this[e(431)][e(441)] = t[e(441)] || 1e3, this.defaultAnimationOptions.effect = t.effect || "easeLinear";
  }
  moveTo(t, e, i) {
    const s = w;
    let r, a = this.topo;
    if (typeof t == "number" && typeof e === s(438))
      r = { x: t, y: e };
    else {
      if (typeof t != "object" || t.x == null || t.y == null)
        throw new Error("invalid arguments moveTo");
      r = { x: t.x, y: t.y }, i = e;
    }
    return i == null && (i = this.defaultAnimationOptions), this[s(436)](k[s(428)], r, [a.x, a.y], [r.x, r.y], (o) => {
      a.x = o[0], a.y = o[1];
    }, i);
  }
  [w(449)](t, e, i) {
    const s = w;
    let r, a = this.topo;
    if (typeof t == "number" && typeof e === s(438))
      r = { x: t, y: e };
    else {
      if (typeof t != "object" || t.x == null || t.y == null)
        throw new Error("invalid arguments faceTo");
      r = { x: t.x, y: t.y }, i = e;
    }
    i == null && (i = this.defaultAnimationOptions);
    const o = a.direction;
    let l = Math[s(450)](r.y - a.y, r.x - a.x), h = l - o;
    return h > Math.PI ? l = o - (2 * Math.PI - h) : h < -Math.PI && (l = o + (2 * Math.PI + h)), this._anime(k.faceTo, r, [o], [l], (c) => {
      a.direction = c[0];
    }, i);
  }
  forward(t, e) {
    const i = w;
    let s = this.topo;
    const r = s.x + t * Math.cos(s.direction), a = s.y + t * Math.sin(s.direction);
    return this._anime(k[i(445)], t, [s.x, s.y], [r, a], (o) => {
      s.x = o[0], s.y = o[1];
    }, e);
  }
  back(t, e) {
    return this.forward(-t, e);
  }
  turn(t, e) {
    let i = this.topo;
    const s = i.direction, r = s + t;
    return this._anime(k.turn, t, [s], [r], (a) => {
      i.direction = a[0];
    }, e);
  }
  [w(446)](t = Math.PI / 2, e) {
    return this[w(440)](-t, e);
  }
  turnRight(t = Math.PI / 2, e) {
    return this[w(440)](t, e);
  }
  [w(421)](t, e) {
    const i = w;
    let s = this.topo;
    const r = s.direction;
    return this._anime(k[i(440)], t, [r], [t], (a) => {
      s[i(435)] = a[0];
    }, e);
  }
  moveToMark(t, e) {
    const i = w, s = this.topo[i(439)](t);
    return this.moveTo(s, e);
  }
  [w(447)](t, e) {
    const i = w, s = this.topo[i(439)](t);
    return this[i(449)](s, e);
  }
  [w(443)](t, e) {
    const i = w, s = this.topo.getMark(t), r = this.moveTo(s, e), a = this[i(421)](s[i(435)], e);
    return Promise.all([r, a]);
  }
  [w(436)](t, e, i, s, r, a) {
    const o = w;
    a == null && (a = this[o(431)]);
    let l = this.topo, h = this.animation;
    return h[o(444)]({ from: i, to: s, update: (c) => {
      r(c);
    }, duration: a.duration || this.defaultDuration, effect: a.effect || this.defaultEffect }), h[o(429)]().then(() => {
      if (l.hasListener(t)) {
        let c = vt[t];
        c.args = e, l.dispatchEvent(c);
      }
    });
  }
  abort() {
    const t = w;
    return this.animation && this.animation[t(448)](), this;
  }
}
const q = P;
function P(n, t) {
  const e = ye();
  return (P = function(i, s) {
    return e[i -= 370];
  })(n, t);
}
(function() {
  const n = P, t = ye();
  for (; ; )
    try {
      if (-parseInt(n(387)) / 1 * (parseInt(n(393)) / 2) + -parseInt(n(394)) / 3 * (-parseInt(n(384)) / 4) + -parseInt(n(389)) / 5 + parseInt(n(386)) / 6 * (-parseInt(n(382)) / 7) + -parseInt(n(408)) / 8 + parseInt(n(395)) / 9 + -parseInt(n(405)) / 10 * (-parseInt(n(375)) / 11) === 846363)
        break;
      t.push(t.shift());
    } catch {
      t.push(t.shift());
    }
})();
class Dn extends Sn {
  constructor(t) {
    const e = P;
    super(), this[e(370)] = [], this[e(373)] = new On(this), this[e(372)] = t, t.animationSystem.add(this.animator.animation);
  }
  onPositionChanged() {
    const t = P;
    for (let e = 0; e < this.carriedObjects[t(392)]; e++)
      this.carriedObjects[e][t(380)](this.x, this.y);
    this.body && this.body[t(380)](this.x, this.y);
  }
  onDirectionChanged() {
    const t = P;
    for (let e = 0; e < this.carriedObjects.length; e++)
      this.carriedObjects[e].rotate(this[t(385)]);
    this[t(374)] && this.body[t(406)](this.direction);
  }
  setBody(t) {
    return this.body = t, this;
  }
  carry(t) {
    const e = P;
    return Array.isArray(t) ? this.carriedObjects = this[e(370)].concat(t) : this[e(370)][e(400)](t), this;
  }
  throw(t, e = 0, i = 0) {
    const s = P;
    let r = this.x, a = this.y;
    if ((i > 0 || e != 0) && (r += i * Math.cos(this[s(385)] + e), a += i * Math[s(407)](this.direction + e)), this.carriedObjects[s(376)](t)) {
      t.x = r, t.y = a;
      let o = this.carriedObjects[s(397)](t);
      this.carriedObjects.splice(o, 1);
    }
    return this;
  }
  throwTo(t, e, i) {
    const s = P;
    if (typeof e === s(398) && typeof i == "number") {
      let r = Math.atan2(i - this.y, e - this.x) - this.direction, a = Math.sqrt((e - this.x) ** 2 + (i - this.y) ** 2);
      return this.throw(t, r, a);
    }
    if (typeof e == "object") {
      let r = Math[s(379)](e.y - this.y, e.x - this.x) - this.direction, a = Math.sqrt((e.x - this.x) ** 2 + (e.y - this.y) ** 2);
      return this.throw(t, r, a);
    }
    throw new Error("invalid arguments throwTo");
  }
  [q(399)](t) {
    const e = q;
    if (this[e(370)].includes(t)) {
      t.x = this.x, t.y = this.y;
      let i = this.carriedObjects.indexOf(t);
      this.carriedObjects[e(383)](i, 1);
    }
    return this;
  }
  reset() {
    const t = q;
    return super.reset(), this.animator && this.animator.animation && this[t(373)].animation[t(402)](), this;
  }
}
class On extends Tn {
  constructor(t) {
    super(t);
  }
  carry(t, e) {
    const i = q;
    let s = this.topo;
    s.carry(t);
    let r = Array.isArray(t) ? t : [t], a = r.map((h) => [h.x, h.y, h.rotation]), o = r[i(371)]((h) => [s.x, s.y, s[i(385)]]);
    e == null && (e = this.defaultAnimationOptions);
    let l = new N();
    return l[i(391)]({ from: a[i(388)](), to: o.flat(), duration: e.duration || this[i(403)].duration, effect: e.effect, update: (h) => {
      const c = i;
      if (Number.isNaN(h[0]))
        throw new Error("args[0] is NaN");
      for (let p = 0; p < r.length; p++)
        r[p].x = h[3 * p], r[p].y = h[3 * p + 1], r[p][c(377)] = h[3 * p + 2];
    } }), this.topo._stageRef.animationSystem.add(l), l.play();
  }
  throw(t, e = 0, i = 0, s) {
    const r = q;
    let a = this[r(381)];
    if (!a[r(370)].includes(t))
      throw new Error("object is not in carriedObjects");
    s == null && (s = this.defaultAnimationOptions);
    let o = a.x, l = a.y;
    i > 0 && (o += i * Math.cos(a.direction + e), l += i * Math.sin(a[r(385)] + e)), e != 0 && (o += i * Math.cos(a.direction + e), l += i * Math.sin(a.direction + e));
    let h = new N();
    h.setAttributes({ from: [a.x, a.y], to: [o, l], duration: s[r(378)], effect: s[r(404)], update: (p) => {
      t.x = p[0], t.y = p[1];
    } }), this.topo._stageRef[r(390)].add(h);
    let c = a.carriedObjects.indexOf(t);
    return this.topo.carriedObjects[r(383)](c, 1), h[r(401)]();
  }
  throwTo(t, e, i, s) {
    const r = q;
    let a, o = this.topo;
    if (typeof e == "number" && typeof i == "number")
      a = { x: e, y: i };
    else {
      if (typeof e != "object" || e.x == null || e.y == null)
        throw new Error("invalid arguments throwTo");
      a = { x: e.x, y: e.y }, s = i;
    }
    s == null && (s = this.defaultAnimationOptions);
    let l = new N();
    l.setAttributes({ from: [o.x, o.y], to: [a.x, a.y], duration: s.duration, effect: s.effect, update: (c) => {
      t.x = c[0], t.y = c[1];
    } }), this.topo._stageRef[r(390)].add(l);
    let h = o[r(370)][r(397)](t);
    return this.topo.carriedObjects.splice(h, 1), l.play();
  }
  putDown(t, e) {
    const i = q;
    let s = this.topo;
    s.putDown(t), e == null && (e = this.defaultAnimationOptions);
    let r = new N();
    return r.setAttributes({ from: [t.x, t.y], to: [s.x, s.y], duration: e[i(378)], effect: e[i(404)], update: (a) => {
      t.x = a[0], t.y = a[1];
    } }), this.topo._stageRef.animationSystem[i(396)](r), r.play();
  }
}
function ye() {
  const n = ["includes", "rotation", "duration", "atan2", "setXY", "topo", "98bfXDWV", "splice", "148QHcPTX", "direction", "655476QABVAi", "26wKWzuf", "flat", "2724495oFAOhs", "animationSystem", "setAttributes", "length", "109172SlvrpS", "125985VmOlzE", "3756420eiOnQu", "add", "indexOf", "number", "putDown", "push", "play", "cancel", "defaultAnimationOptions", "effect", "20uXNRUj", "rotate", "sin", "9573368odWkYr", "carriedObjects", "map", "_stageRef", "animator", "body", "19609799sUqATd"];
  return (ye = function() {
    return n;
  })();
}
function xe() {
  const n = ["3856632ieGuFS", "10HLVTmW", "2280087FiHEhn", "5658180mBTuNr", "createElement", "11AHHQsC", "256vWzZTA", "1844190prnhAq", "head", "6JfKOhY", "129469hOkVnd", "28tioSix", "48986BCBHeS", "66489gTXDJH"];
  return (xe = function() {
    return n;
  })();
}
function qt(n, t) {
  const e = xe();
  return (qt = function(i, s) {
    return e[i -= 371];
  })(n, t);
}
(function() {
  const n = qt, t = xe();
  for (; ; )
    try {
      if (-parseInt(n(373)) / 1 * (-parseInt(n(372)) / 2) + -parseInt(n(376)) / 3 * (parseInt(n(374)) / 4) + parseInt(n(384)) / 5 + -parseInt(n(377)) / 6 + parseInt(n(375)) / 7 * (-parseInt(n(383)) / 8) + parseInt(n(379)) / 9 * (parseInt(n(378)) / 10) + -parseInt(n(382)) / 11 * (-parseInt(n(380)) / 12) === 460254)
        break;
      t.push(t.shift());
    } catch {
      t.push(t.shift());
    }
})(), function() {
  const n = qt;
  let t = document[n(371)] || document.getElementsByTagName("head")[0], e = document.getElementById("_jtopo_style_");
  e == null && (e = document[n(381)]("style"), e.id = "_jtopo_style_", e.textContent = `.jtopo_popoupmenu{padding:10px;border-radius:5px;min-width:210px;background-color:#fff;border:1px solid;position:absolute;z-index:10000}.jtopo_popoupmenu .header{font-size:14px;height:24px;padding-bottom:3px}.jtopo_popoupmenu a{text-rendering:optimizeLegibility;font-family:Open Sans,Helvetica Neue,Helvetica,Arial,sans-serif;padding-left:20px;display:block;height:25px;color:#00000080;font-size:13px;cursor:pointer}.jtopo_popoupmenu a:hover{color:#000}.jtopo_iconsPanel{opacity:.98;padding:3px;position:absolute;background-color:#e8e8e8;top:20px;width:52px;z-index:1000;border-radius:5px}.jtopo_iconsPanel .item{border:1px solid white;width:42px;height:42px;margin:4px 2px 0}.jtopo_toolbar{border-bottom:1px dotted;padding-bottom:2px;border-color:#e0e0e0;width:100%;min-height:33px;background-color:#e8e8e8}.jtopo_toolbar .group{float:left;margin-right:5px}.jtopo_toolbar .item{float:left;width:32px;height:32px;stroke:gray;stroke-width:1;stroke-linecap:square;stroke-linejoin:miter;fill:none;font-size:12px;color:gray}.jtopo_toolbar .active{background-color:#d3d3d3;border:1px solid black}.jtopo_toolbar input[type=text]{font-size:12px;color:gray;float:left;width:120px;height:26px;border:1px solid white;margin:2px 2px 2px 4px}.jtopo_input_textfield{position:absolute;display:none;font-size:smaller;z-index:10000;border:1px gray dotted;padding:0;margin:0;word-break:none;word-wrap:none;outline:none;box-shadow:0 0 5px #0000ff80;overflow:hidden;resize:none}.jtopo_tooltip{pointer-events:none;opacity:.9;min-width:30px;min-height:30px;padding:10px;border-radius:5px;background-color:#f8f8f8;border:1px solid;position:absolute;z-index:10000}.jtopo_debugPanel{-webkit-user-select:none;user-select:none;border:dashed 1px gray;padding:8px;position:absolute;left:0;top:0%;width:300px;z-index:98;text-align:left;font-size:14px;color:gray}
`, t.appendChild(e));
}();
export {
  zn as AssetsLoader,
  _e as BlinkingArrowNode,
  ze as GifNode,
  Wn as InputTextfield,
  Oe as InputTextfieldEvent,
  je as JointLNode,
  Pn as PopupMenu,
  Rt as RatioNode,
  Ne as RipplingNode,
  Nn as Toolbar,
  _n as Tooltip,
  Dn as TopoRobot,
  We as WaterLikeNode
};
